|
@@ -47,7 +47,7 @@ describe( 'EditorUI', () => {
|
|
|
expect( ui.focusTracker ).to.be.instanceOf( FocusTracker );
|
|
expect( ui.focusTracker ).to.be.instanceOf( FocusTracker );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- it( 'should fire throttled update event after viewDocument#layoutChanged', () => {
|
|
|
|
|
|
|
+ it( 'should fire update event after viewDocument#layoutChanged', () => {
|
|
|
const spy = sinon.spy();
|
|
const spy = sinon.spy();
|
|
|
|
|
|
|
|
ui.on( 'update', spy );
|
|
ui.on( 'update', spy );
|
|
@@ -58,16 +58,12 @@ describe( 'EditorUI', () => {
|
|
|
|
|
|
|
|
editor.editing.view.document.fire( 'layoutChanged' );
|
|
editor.editing.view.document.fire( 'layoutChanged' );
|
|
|
|
|
|
|
|
- sinon.assert.calledOnce( spy );
|
|
|
|
|
-
|
|
|
|
|
- ui._throttledUpdate.flush();
|
|
|
|
|
-
|
|
|
|
|
sinon.assert.calledTwice( spy );
|
|
sinon.assert.calledTwice( spy );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( 'update()', () => {
|
|
describe( 'update()', () => {
|
|
|
- it( 'should fire throttled update event', () => {
|
|
|
|
|
|
|
+ it( 'should fire update event', () => {
|
|
|
const spy = sinon.spy();
|
|
const spy = sinon.spy();
|
|
|
|
|
|
|
|
ui.on( 'update', spy );
|
|
ui.on( 'update', spy );
|
|
@@ -78,10 +74,6 @@ describe( 'EditorUI', () => {
|
|
|
|
|
|
|
|
ui.update();
|
|
ui.update();
|
|
|
|
|
|
|
|
- sinon.assert.calledOnce( spy );
|
|
|
|
|
-
|
|
|
|
|
- ui._throttledUpdate.flush();
|
|
|
|
|
-
|
|
|
|
|
sinon.assert.calledTwice( spy );
|
|
sinon.assert.calledTwice( spy );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
@@ -102,22 +94,5 @@ describe( 'EditorUI', () => {
|
|
|
|
|
|
|
|
sinon.assert.called( spy );
|
|
sinon.assert.called( spy );
|
|
|
} );
|
|
} );
|
|
|
-
|
|
|
|
|
- it( 'should cancel throttled update event', () => {
|
|
|
|
|
- const spy = sinon.spy();
|
|
|
|
|
-
|
|
|
|
|
- ui.on( 'update', spy );
|
|
|
|
|
-
|
|
|
|
|
- ui.update();
|
|
|
|
|
-
|
|
|
|
|
- sinon.assert.calledOnce( spy );
|
|
|
|
|
-
|
|
|
|
|
- ui.destroy();
|
|
|
|
|
-
|
|
|
|
|
- ui.update();
|
|
|
|
|
- ui._throttledUpdate.flush();
|
|
|
|
|
-
|
|
|
|
|
- sinon.assert.calledOnce( spy );
|
|
|
|
|
- } );
|
|
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|