|
|
@@ -47,7 +47,7 @@ describe( 'ContextualToolbar', () => {
|
|
|
sandbox.stub( balloon.view, 'pin' ).returns( {} );
|
|
|
|
|
|
// Focus the engine.
|
|
|
- editingView.isFocused = true;
|
|
|
+ editingView.document.isFocused = true;
|
|
|
editingView.getDomRoot().focus();
|
|
|
|
|
|
// Remove all selection ranges from DOM before testing.
|
|
|
@@ -171,7 +171,7 @@ describe( 'ContextualToolbar', () => {
|
|
|
] );
|
|
|
|
|
|
balloonAddSpy = sandbox.spy( balloon, 'add' );
|
|
|
- editingView.isFocused = true;
|
|
|
+ editingView.document.isFocused = true;
|
|
|
} );
|
|
|
|
|
|
it( 'should add #toolbarView to the #_balloon and attach the #_balloon to the selection for the forward selection', () => {
|
|
|
@@ -243,17 +243,17 @@ describe( 'ContextualToolbar', () => {
|
|
|
expect( balloonAddSpy.firstCall.args[ 0 ].position.target() ).to.deep.equal( backwardSelectionRect );
|
|
|
} );
|
|
|
|
|
|
- it( 'should update balloon position on ViewDocument#render event while balloon is added to the #_balloon', () => {
|
|
|
+ it( 'should update balloon position on view#change event while balloon is added to the #_balloon', () => {
|
|
|
setData( model, '<paragraph>b[a]r</paragraph>' );
|
|
|
|
|
|
const spy = sandbox.spy( balloon, 'updatePosition' );
|
|
|
|
|
|
- editingView.fire( 'render' );
|
|
|
+ editingView.fire( 'change' );
|
|
|
|
|
|
contextualToolbar.show();
|
|
|
sinon.assert.notCalled( spy );
|
|
|
|
|
|
- editingView.fire( 'render' );
|
|
|
+ editingView.fire( 'change' );
|
|
|
sinon.assert.calledOnce( spy );
|
|
|
} );
|
|
|
|
|
|
@@ -297,7 +297,7 @@ describe( 'ContextualToolbar', () => {
|
|
|
|
|
|
it( 'should not be called when the editor is not focused', () => {
|
|
|
setData( model, '<paragraph>b[a]r</paragraph>' );
|
|
|
- editingView.isFocused = false;
|
|
|
+ editingView.document.isFocused = false;
|
|
|
|
|
|
contextualToolbar.fire( '_selectionChangeDebounced' );
|
|
|
sinon.assert.notCalled( showSpy );
|
|
|
@@ -312,7 +312,7 @@ describe( 'ContextualToolbar', () => {
|
|
|
|
|
|
it( 'should be called when the selection is not collapsed and editor is focused', () => {
|
|
|
setData( model, '<paragraph>b[a]r</paragraph>' );
|
|
|
- editingView.isFocused = true;
|
|
|
+ editingView.document.isFocused = true;
|
|
|
|
|
|
contextualToolbar.fire( '_selectionChangeDebounced' );
|
|
|
sinon.assert.calledOnce( showSpy );
|
|
|
@@ -325,7 +325,7 @@ describe( 'ContextualToolbar', () => {
|
|
|
|
|
|
beforeEach( () => {
|
|
|
removeBalloonSpy = sandbox.stub( balloon, 'remove' ).returns( {} );
|
|
|
- editingView.isFocused = true;
|
|
|
+ editingView.document.isFocused = true;
|
|
|
} );
|
|
|
|
|
|
it( 'should remove #toolbarView from the #_balloon', () => {
|
|
|
@@ -337,7 +337,7 @@ describe( 'ContextualToolbar', () => {
|
|
|
sinon.assert.calledWithExactly( removeBalloonSpy, contextualToolbar.toolbarView );
|
|
|
} );
|
|
|
|
|
|
- it( 'should stop update balloon position on ViewDocument#render event', () => {
|
|
|
+ it( 'should stop update balloon position on ViewDocument#change event', () => {
|
|
|
setData( model, '<paragraph>b[a]r</paragraph>' );
|
|
|
|
|
|
const spy = sandbox.spy( balloon, 'updatePosition' );
|
|
|
@@ -345,7 +345,7 @@ describe( 'ContextualToolbar', () => {
|
|
|
contextualToolbar.show();
|
|
|
contextualToolbar.hide();
|
|
|
|
|
|
- editingView.fire( 'render' );
|
|
|
+ editingView.fire( 'change' );
|
|
|
sinon.assert.notCalled( spy );
|
|
|
} );
|
|
|
|