From 8509bccc4fdfe793d7f97423f302e9464541a32f Mon Sep 17 00:00:00 2001 From: Andrey Savin <69673750+anti-the-social@users.noreply.github.com> Date: Sat, 10 Dec 2022 13:06:22 +0200 Subject: [PATCH] Fix comment tests to support testing in different time zones --- src/file/paragraph/run/comment-run.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/file/paragraph/run/comment-run.spec.ts b/src/file/paragraph/run/comment-run.spec.ts index 1900f31c03..62d3a624b8 100644 --- a/src/file/paragraph/run/comment-run.spec.ts +++ b/src/file/paragraph/run/comment-run.spec.ts @@ -44,7 +44,7 @@ describe("Comment", () => { let clock: sinon.SinonFakeTimers; beforeEach(() => { - const now = new Date(1999, 0, 1); + const now = new Date("1999-01-01T00:00:00.000Z"); clock = sinon.useFakeTimers(now.getTime()); }); @@ -57,7 +57,7 @@ describe("Comment", () => { const component = new Comment({ id: 0, text: "test-comment", - date: new Date(1999, 0, 1), + date: new Date("1999-01-01T00:00:00.000Z"), }); const tree = new Formatter().format(component); expect(tree).to.deep.equal({ @@ -126,12 +126,12 @@ describe("Comments", () => { { id: 0, text: "test-comment", - date: new Date(1999, 0, 1), + date: new Date("1999-01-01T00:00:00.000Z"), }, { id: 1, text: "test-comment-2", - date: new Date(1999, 0, 1), + date: new Date("1999-01-01T00:00:00.000Z"), }, ], });