Преглед изворни кода

Merge pull request #13175 from overleaf/msm-flaky-tests

[web] replace clock.runAll() with clock.next() in flaky tests

GitOrigin-RevId: 62ea59315597d9ecd0e143418f65382644ed8345
Alf Eaton пре 3 година
родитељ
комит
a5378ebd49
1 измењених фајлова са 4 додато и 12 уклоњено
  1. 4 12
      services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandlerTests.js

+ 4 - 12
services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandlerTests.js

@@ -502,13 +502,9 @@ function expectProjectCreated() {
     ).to.have.been.calledWith(this.userId, this.projectName)
     ).to.have.been.calledWith(this.userId, this.projectName)
   })
   })
 
 
-  /**
-   * Temporarily disable flaky test
-   */
-  // eslint-disable-next-line mocha/no-skipped-tests
-  it.skip('sets the root doc', function () {
+  it('sets the root doc', function () {
     // Fire pending timers
     // Fire pending timers
-    this.clock.runAll()
+    this.clock.next()
     expect(
     expect(
       this.RootDocManager.promises.setRootDocAutomatically
       this.RootDocManager.promises.setRootDocAutomatically
     ).to.have.been.calledWith(this.projects.active1._id)
     ).to.have.been.calledWith(this.projects.active1._id)
@@ -521,13 +517,9 @@ function expectProjectNotCreated() {
       .been.called
       .been.called
   })
   })
 
 
-  /**
-   * Temporarily disable flaky test
-   */
-  // 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
     // Fire pending timers
-    this.clock.runAll()
+    this.clock.next()
     expect(this.RootDocManager.promises.setRootDocAutomatically).not.to.have
     expect(this.RootDocManager.promises.setRootDocAutomatically).not.to.have
       .been.called
       .been.called
   })
   })