|
|
@@ -32,7 +32,7 @@ import { getData as getModelData, setData as setModelData } from '@ckeditor/cked
|
|
|
import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
|
|
|
|
|
|
describe( 'Input feature', () => {
|
|
|
- let editor, model, modelRoot, view, viewRoot, listenter;
|
|
|
+ let editor, model, modelRoot, view, viewDocument, viewRoot, listenter;
|
|
|
|
|
|
testUtils.createSinonSandbox();
|
|
|
|
|
|
@@ -59,7 +59,8 @@ describe( 'Input feature', () => {
|
|
|
model = editor.model;
|
|
|
modelRoot = model.document.getRoot();
|
|
|
view = editor.editing.view;
|
|
|
- viewRoot = view.getRoot();
|
|
|
+ viewDocument = view.document;
|
|
|
+ viewRoot = viewDocument.getRoot();
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
@@ -83,7 +84,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
describe( 'mutations handling', () => {
|
|
|
it( 'should handle text mutation', () => {
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'foobar',
|
|
|
@@ -97,7 +98,7 @@ describe( 'Input feature', () => {
|
|
|
} );
|
|
|
|
|
|
it( 'should handle text mutation change', () => {
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'foobar',
|
|
|
@@ -113,7 +114,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should handle text node insertion', () => {
|
|
|
editor.setData( '<p></p>' );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [],
|
|
|
@@ -133,7 +134,7 @@ describe( 'Input feature', () => {
|
|
|
italic: true
|
|
|
}
|
|
|
} );
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [],
|
|
|
@@ -150,7 +151,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should handle multiple text mutations', () => {
|
|
|
editor.setData( '<p>foo<strong>bar</strong></p>' );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'foo',
|
|
|
@@ -172,7 +173,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should handle multiple text node insertion', () => {
|
|
|
editor.setData( '<p></p><p></p>' );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [],
|
|
|
@@ -194,7 +195,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should do nothing when two nodes were inserted', () => {
|
|
|
editor.setData( '<p></p>' );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [],
|
|
|
@@ -208,7 +209,7 @@ describe( 'Input feature', () => {
|
|
|
} );
|
|
|
|
|
|
it( 'should do nothing when two nodes were inserted and one removed', () => {
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [ new ViewText( 'foobar' ) ],
|
|
|
@@ -224,7 +225,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should handle multiple children in the node', () => {
|
|
|
editor.setData( '<p>foo<img></img></p>' );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [ new ViewText( 'foo' ), viewRoot.getChild( 0 ).getChild( 1 ) ],
|
|
|
@@ -238,7 +239,7 @@ describe( 'Input feature', () => {
|
|
|
} );
|
|
|
|
|
|
it( 'should do nothing when node was removed', () => {
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [ new ViewText( 'foobar' ) ],
|
|
|
@@ -254,7 +255,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should do nothing when element was inserted', () => {
|
|
|
editor.setData( '<p></p>' );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
oldChildren: [],
|
|
|
@@ -271,9 +272,9 @@ describe( 'Input feature', () => {
|
|
|
// This test case emulates spellchecker correction.
|
|
|
|
|
|
const viewSelection = new ViewSelection();
|
|
|
- viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
|
|
|
+ viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
|
|
|
|
|
|
- view.fire( 'mutations',
|
|
|
+ viewDocument.fire( 'mutations',
|
|
|
[ {
|
|
|
type: 'text',
|
|
|
oldText: 'foobar',
|
|
|
@@ -291,12 +292,12 @@ describe( 'Input feature', () => {
|
|
|
// This test case emulates spellchecker correction.
|
|
|
|
|
|
const viewSelection = new ViewSelection();
|
|
|
- viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
|
|
|
+ viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
|
|
|
|
|
|
testUtils.sinon.spy( Writer.prototype, 'insert' );
|
|
|
testUtils.sinon.spy( Writer.prototype, 'remove' );
|
|
|
|
|
|
- view.fire( 'mutations',
|
|
|
+ viewDocument.fire( 'mutations',
|
|
|
[ {
|
|
|
type: 'text',
|
|
|
oldText: 'foobar',
|
|
|
@@ -315,9 +316,9 @@ describe( 'Input feature', () => {
|
|
|
editor.setData( '<p>Foo hous a</p>' );
|
|
|
|
|
|
const viewSelection = new ViewSelection();
|
|
|
- viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
+ viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
|
|
|
- view.fire( 'mutations',
|
|
|
+ viewDocument.fire( 'mutations',
|
|
|
[ {
|
|
|
type: 'text',
|
|
|
oldText: 'Foo hous a',
|
|
|
@@ -336,9 +337,9 @@ describe( 'Input feature', () => {
|
|
|
editor.setData( '<p>Bar athat foo</p>' );
|
|
|
|
|
|
const viewSelection = new ViewSelection();
|
|
|
- viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
|
|
|
+ viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
|
|
|
|
|
|
- view.fire( 'mutations',
|
|
|
+ viewDocument.fire( 'mutations',
|
|
|
[ {
|
|
|
type: 'text',
|
|
|
oldText: 'Bar athat foo',
|
|
|
@@ -357,9 +358,9 @@ describe( 'Input feature', () => {
|
|
|
editor.setData( '<p>Foo hous e</p>' );
|
|
|
|
|
|
const viewSelection = new ViewSelection();
|
|
|
- viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
+ viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
|
|
|
- view.fire( 'mutations',
|
|
|
+ viewDocument.fire( 'mutations',
|
|
|
[ {
|
|
|
type: 'text',
|
|
|
oldText: 'Foo hous e',
|
|
|
@@ -377,10 +378,10 @@ describe( 'Input feature', () => {
|
|
|
editor.setData( '<p>Foo house</p>' );
|
|
|
|
|
|
const viewSelection = new ViewSelection();
|
|
|
- viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
|
|
|
- viewSelection.setFocus( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
+ viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
|
|
|
+ viewSelection._setFocus( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
|
|
|
- view.fire( 'mutations',
|
|
|
+ viewDocument.fire( 'mutations',
|
|
|
[ {
|
|
|
type: 'text',
|
|
|
oldText: 'Foo house',
|
|
|
@@ -401,7 +402,7 @@ describe( 'Input feature', () => {
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'foobar',
|
|
|
@@ -421,7 +422,7 @@ describe( 'Input feature', () => {
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'foobar',
|
|
|
@@ -441,7 +442,7 @@ describe( 'Input feature', () => {
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'foobar',
|
|
|
@@ -462,7 +463,7 @@ describe( 'Input feature', () => {
|
|
|
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) );
|
|
|
} );
|
|
|
|
|
|
- listenter.listenTo( view, 'keydown', () => {
|
|
|
+ listenter.listenTo( viewDocument, 'keydown', () => {
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[]ar</paragraph>' );
|
|
|
}, { priority: 'lowest' } );
|
|
|
} );
|
|
|
@@ -471,10 +472,10 @@ describe( 'Input feature', () => {
|
|
|
it( 'should remove contents and merge blocks', () => {
|
|
|
setModelData( model, '<paragraph>fo[o</paragraph><paragraph>b]ar</paragraph>' );
|
|
|
|
|
|
- listenter.listenTo( view, 'keydown', () => {
|
|
|
+ listenter.listenTo( viewDocument, 'keydown', () => {
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[]ar</paragraph>' );
|
|
|
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'foar',
|
|
|
@@ -484,7 +485,7 @@ describe( 'Input feature', () => {
|
|
|
] );
|
|
|
}, { priority: 'lowest' } );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'y' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'y' ) } );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>foy[]ar</paragraph>' );
|
|
|
expect( getViewData( view ) ).to.equal( '<p>foy{}ar</p>' );
|
|
|
@@ -496,7 +497,7 @@ describe( 'Input feature', () => {
|
|
|
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) );
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'arrowdown' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'arrowdown' ) } );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
|
|
|
} );
|
|
|
@@ -507,7 +508,7 @@ describe( 'Input feature', () => {
|
|
|
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) );
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'keydown', { ctrlKey: true, keyCode: getCode( 'c' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { ctrlKey: true, keyCode: getCode( 'c' ) } );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
|
|
|
} );
|
|
|
@@ -518,9 +519,9 @@ describe( 'Input feature', () => {
|
|
|
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) );
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: 16 } ); // Shift
|
|
|
- view.fire( 'keydown', { keyCode: 35 } ); // Home
|
|
|
- view.fire( 'keydown', { keyCode: 112 } ); // F1
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 16 } ); // Shift
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 35 } ); // Home
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 112 } ); // F1
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
|
|
|
} );
|
|
|
@@ -532,7 +533,7 @@ describe( 'Input feature', () => {
|
|
|
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) );
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: 9 } ); // Tab
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 9 } ); // Tab
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
|
|
|
} );
|
|
|
@@ -544,13 +545,13 @@ describe( 'Input feature', () => {
|
|
|
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) );
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: 229 } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 229 } );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
|
|
|
} );
|
|
|
|
|
|
it( 'should do nothing if selection is collapsed', () => {
|
|
|
- view.fire( 'keydown', { ctrlKey: true, keyCode: getCode( 'c' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { ctrlKey: true, keyCode: getCode( 'c' ) } );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>foo[]bar</paragraph>' );
|
|
|
} );
|
|
|
@@ -565,7 +566,7 @@ describe( 'Input feature', () => {
|
|
|
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) );
|
|
|
} );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'y' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'y' ) } );
|
|
|
|
|
|
expect( lockSpy.calledOnce ).to.be.true;
|
|
|
expect( unlockSpy.calledOnce ).to.be.true;
|
|
|
@@ -576,9 +577,9 @@ describe( 'Input feature', () => {
|
|
|
const lockSpy = testUtils.sinon.spy( buffer, 'lock' );
|
|
|
const unlockSpy = testUtils.sinon.spy( buffer, 'unlock' );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: 16 } ); // Shift
|
|
|
- view.fire( 'keydown', { keyCode: 35 } ); // Home
|
|
|
- view.fire( 'keydown', { keyCode: 112 } ); // F1
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 16 } ); // Shift
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 35 } ); // Home
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: 112 } ); // F1
|
|
|
|
|
|
expect( lockSpy.callCount ).to.be.equal( 0 );
|
|
|
expect( unlockSpy.callCount ).to.be.equal( 0 );
|
|
|
@@ -589,9 +590,9 @@ describe( 'Input feature', () => {
|
|
|
const lockSpy = testUtils.sinon.spy( buffer, 'lock' );
|
|
|
const unlockSpy = testUtils.sinon.spy( buffer, 'unlock' );
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'b' ) } );
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'a' ) } );
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'z' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'b' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'a' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'z' ) } );
|
|
|
|
|
|
expect( lockSpy.callCount ).to.be.equal( 0 );
|
|
|
expect( unlockSpy.callCount ).to.be.equal( 0 );
|
|
|
@@ -602,7 +603,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
editor.commands.get( 'input' ).isEnabled = false;
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'b' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'b' ) } );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>foo[]bar</paragraph>' );
|
|
|
} );
|
|
|
@@ -612,7 +613,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
editor.commands.get( 'input' ).isEnabled = false;
|
|
|
|
|
|
- view.fire( 'keydown', { keyCode: getCode( 'b' ) } );
|
|
|
+ viewDocument.fire( 'keydown', { keyCode: getCode( 'b' ) } );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
|
|
|
} );
|
|
|
@@ -639,7 +640,8 @@ describe( 'Input feature', () => {
|
|
|
model = editor.model;
|
|
|
modelRoot = model.document.getRoot();
|
|
|
view = editor.editing.view;
|
|
|
- viewRoot = view.getRoot();
|
|
|
+ viewDocument = view.document;
|
|
|
+ viewRoot = viewDocument.getRoot();
|
|
|
domRoot = view.getDomRoot();
|
|
|
|
|
|
// Mock image feature.
|
|
|
@@ -686,7 +688,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<i><a href="foo">text</a>x</i>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
// First mutation - remove all children from link element.
|
|
|
{
|
|
|
type: 'children',
|
|
|
@@ -733,7 +735,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<i>x<a href="foo">text</a></i>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
// First mutation - remove all children from link element.
|
|
|
{
|
|
|
type: 'children',
|
|
|
@@ -781,7 +783,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = 'xxx<i><a href="foo">text</a>x</i>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
// First mutation - remove all children from link element.
|
|
|
{
|
|
|
type: 'children',
|
|
|
@@ -827,7 +829,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<b>fixed text</b>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
// Replace `<strong>` with `<b>`.
|
|
|
{
|
|
|
type: 'children',
|
|
|
@@ -858,7 +860,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].childNodes[ 0 ].innerHTML = 'this is bar text';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
node: strong,
|
|
|
@@ -886,7 +888,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<strong>text</strong><img />';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
node: paragraph,
|
|
|
@@ -917,7 +919,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<strong>text</strong>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
node: paragraph,
|
|
|
@@ -942,7 +944,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<strong>text</strong>';
|
|
|
- view.fire( 'mutations', [] );
|
|
|
+ viewDocument.fire( 'mutations', [] );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal( '<p><strong>text{}</strong></p>' );
|
|
|
} );
|
|
|
@@ -963,7 +965,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<strong>text</strong>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'children',
|
|
|
node: paragraph,
|
|
|
@@ -998,7 +1000,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<b>textx</b>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
// Replace `<strong>` with `<b>`.
|
|
|
{
|
|
|
type: 'children',
|
|
|
@@ -1022,7 +1024,7 @@ describe( 'Input feature', () => {
|
|
|
|
|
|
// Simulate mutations and DOM change.
|
|
|
domRoot.childNodes[ 0 ].innerHTML = '<strong>Foo bar </strong><b>apple</b>';
|
|
|
- view.fire( 'mutations', [
|
|
|
+ viewDocument.fire( 'mutations', [
|
|
|
{
|
|
|
type: 'text',
|
|
|
oldText: 'Foo bar aple',
|