|
|
@@ -145,7 +145,7 @@ describe( 'Autosave', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
- it( 'should filter out batches that don\'t change content', () => {
|
|
|
+ it( 'should filter out change batches that don\'t change content', () => {
|
|
|
autosave.provider = {
|
|
|
save: sandbox.spy()
|
|
|
};
|
|
|
@@ -158,6 +158,34 @@ describe( 'Autosave', () => {
|
|
|
sinon.assert.notCalled( autosave.provider.save );
|
|
|
} );
|
|
|
|
|
|
+ it( 'should filter out change batches that don\'t change content #2', () => {
|
|
|
+ autosave.provider = {
|
|
|
+ save: sandbox.spy()
|
|
|
+ };
|
|
|
+
|
|
|
+ const operation = { name: 'user:position' };
|
|
|
+ editor.model.document.fire( 'change', {
|
|
|
+ deltas: [ { operations: [ operation ] } ]
|
|
|
+ } );
|
|
|
+
|
|
|
+ autosave._flush();
|
|
|
+ sinon.assert.notCalled( autosave.provider.save );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'should filter out change batches that don\'t change content #3', () => {
|
|
|
+ autosave.provider = {
|
|
|
+ save: sandbox.spy()
|
|
|
+ };
|
|
|
+
|
|
|
+ const operation = { name: 'user:range' };
|
|
|
+ editor.model.document.fire( 'change', {
|
|
|
+ deltas: [ { operations: [ operation ] } ]
|
|
|
+ } );
|
|
|
+
|
|
|
+ autosave._flush();
|
|
|
+ sinon.assert.notCalled( autosave.provider.save );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should flush remaining calls after editor\'s destroy', () => {
|
|
|
const spy = sandbox.spy();
|
|
|
const savedStates = [];
|