|
@@ -128,7 +128,7 @@ describe( 'DeltaReplayer', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( 'play', () => {
|
|
describe( 'play', () => {
|
|
|
- it( 'should play deltas with time interval', ( done ) => {
|
|
|
|
|
|
|
+ it( 'should play deltas with time interval', () => {
|
|
|
const doc = getDocument();
|
|
const doc = getDocument();
|
|
|
|
|
|
|
|
const stringifiedDeltas = [ getFirstDelta(), getSecondDelta() ]
|
|
const stringifiedDeltas = [ getFirstDelta(), getSecondDelta() ]
|
|
@@ -137,12 +137,18 @@ describe( 'DeltaReplayer', () => {
|
|
|
|
|
|
|
|
const deltaReplayer = new DeltaReplayer( doc, '---', stringifiedDeltas );
|
|
const deltaReplayer = new DeltaReplayer( doc, '---', stringifiedDeltas );
|
|
|
|
|
|
|
|
- deltaReplayer.play( 0, () => {
|
|
|
|
|
|
|
+ return deltaReplayer.play( 0 ).then( () => {
|
|
|
expect( deltaReplayer.getDeltasToReplay().length ).to.equal( 0 );
|
|
expect( deltaReplayer.getDeltasToReplay().length ).to.equal( 0 );
|
|
|
-
|
|
|
|
|
- done();
|
|
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should work with default time interval', () => {
|
|
|
|
|
+ const doc = getDocument();
|
|
|
|
|
+
|
|
|
|
|
+ const deltaReplayer = new DeltaReplayer( doc, '---', '' );
|
|
|
|
|
+
|
|
|
|
|
+ return deltaReplayer.play();
|
|
|
|
|
+ } );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|