Przeglądaj źródła

Improved tests.

Maciej Bukowski 7 lat temu
rodzic
commit
bc8c64b64e
1 zmienionych plików z 4 dodań i 5 usunięć
  1. 4 5
      packages/ckeditor5-autosave/tests/autosave.js

+ 4 - 5
packages/ckeditor5-autosave/tests/autosave.js

@@ -205,12 +205,11 @@ describe( 'Autosave', () => {
 				expect( pendingActions.isPending ).to.be.true;
 				sinon.assert.calledOnce( serverActionSpy );
 
-				// Wait another 500ms for the second server action.
+				// Wait another 500ms and a promise cycle for the second server action.
 				sandbox.clock.tick( 500 );
-				return Promise.resolve().then( () => {
-					expect( pendingActions.isPending ).to.be.false;
-					sinon.assert.calledTwice( serverActionSpy );
-				} );
+			} ).then( () => {
+				expect( pendingActions.isPending ).to.be.false;
+				sinon.assert.calledTwice( serverActionSpy );
 			} );
 		} );