From e0d85734dc4ca078eb758b2c60bebaed039f9105 Mon Sep 17 00:00:00 2001 From: June Kelly Date: Wed, 17 May 2023 09:27:11 +0100 Subject: [PATCH] Merge pull request #13110 from overleaf/jk-investigate-fake-timers-problem [web] Fix failing unit test involving `fake-timers` GitOrigin-RevId: d166cc10079b9c4fa6d07525a9e6140e86b05fc9 --- .../web/test/unit/src/Project/ProjectUpdateHandlerTests.js | 4 ++++ .../unit/src/ThirdPartyDataStore/TpdsUpdateHandlerTests.js | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/services/web/test/unit/src/Project/ProjectUpdateHandlerTests.js b/services/web/test/unit/src/Project/ProjectUpdateHandlerTests.js index 0cc6354694..dbda832330 100644 --- a/services/web/test/unit/src/Project/ProjectUpdateHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectUpdateHandlerTests.js @@ -22,6 +22,10 @@ describe('ProjectUpdateHandler', function () { this.clock = sinon.useFakeTimers(this.fakeTime.getTime()) }) + afterEach(function () { + this.clock.restore() + }) + beforeEach(function () { let Project this.ProjectModel = Project = class Project {} diff --git a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandlerTests.js b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandlerTests.js index 33a80ec726..d769ffecf7 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandlerTests.js +++ b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandlerTests.js @@ -502,8 +502,7 @@ function expectProjectCreated() { ).to.have.been.calledWith(this.userId, this.projectName) }) - // eslint-disable-next-line mocha/no-skipped-tests - it.skip('sets the root doc', function () { + it('sets the root doc', function () { // Fire pending timers this.clock.runAll() expect( @@ -518,8 +517,7 @@ function expectProjectNotCreated() { .been.called }) - // eslint-disable-next-line mocha/no-skipped-tests - it.skip('does not set the root doc', function () { + it('does not set the root doc', function () { // Fire pending timers this.clock.runAll() expect(this.RootDocManager.promises.setRootDocAutomatically).not.to.have