diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/frontend/helpers/fake_date_spec.js | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-13.6.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/frontend/helpers/fake_date_spec.js')
-rw-r--r-- | spec/frontend/helpers/fake_date_spec.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/frontend/helpers/fake_date_spec.js b/spec/frontend/helpers/fake_date_spec.js index 8afc8225f9b..b3ed13e238a 100644 --- a/spec/frontend/helpers/fake_date_spec.js +++ b/spec/frontend/helpers/fake_date_spec.js @@ -13,13 +13,17 @@ describe('spec/helpers/fake_date', () => { }); it('should use default args', () => { - expect(new FakeDate()).toEqual(new Date(...DEFAULT_ARGS)); - expect(FakeDate()).toEqual(Date(...DEFAULT_ARGS)); + expect(new FakeDate()).toMatchInlineSnapshot(`2020-07-06T00:00:00.000Z`); + }); + + it('should use default args when called as a function', () => { + expect(FakeDate()).toMatchInlineSnapshot( + `"Mon Jul 06 2020 00:00:00 GMT+0000 (Greenwich Mean Time)"`, + ); }); it('should have deterministic now()', () => { - expect(FakeDate.now()).not.toBe(Date.now()); - expect(FakeDate.now()).toBe(new Date(...DEFAULT_ARGS).getTime()); + expect(FakeDate.now()).toMatchInlineSnapshot(`1593993600000`); }); it('should be instanceof Date', () => { |