|
|
@@ -23,18 +23,18 @@ describe( 'Composer', () => {
|
|
|
|
|
|
describe( 'constructor', () => {
|
|
|
it( 'attaches deleteContents default listener', () => {
|
|
|
- setData( document, 'main', '<p>f<selection>oo</p><p>ba</selection>r</p>' );
|
|
|
+ setData( document, '<p>f<selection>oo</p><p>ba</selection>r</p>' );
|
|
|
|
|
|
const batch = document.batch();
|
|
|
|
|
|
composer.fire( 'deleteContents', { batch, selection: document.selection } );
|
|
|
|
|
|
- expect( getData( document, 'main' ) ).to.equal( '<p>f</p><p>r</p>' );
|
|
|
+ expect( getData( document ) ).to.equal( '<p>f</p><p>r</p>' );
|
|
|
expect( batch.deltas ).to.not.be.empty;
|
|
|
} );
|
|
|
|
|
|
it( 'attaches deleteContents default listener which passes options', () => {
|
|
|
- setData( document, 'main', '<p>f<selection>oo</p><p>ba</selection>r</p>' );
|
|
|
+ setData( document, '<p>f<selection>oo</p><p>ba</selection>r</p>' );
|
|
|
|
|
|
const batch = document.batch();
|
|
|
|
|
|
@@ -44,11 +44,11 @@ describe( 'Composer', () => {
|
|
|
options: { merge: true }
|
|
|
} );
|
|
|
|
|
|
- expect( getData( document, 'main' ) ).to.equal( '<p>fr</p>' );
|
|
|
+ expect( getData( document ) ).to.equal( '<p>fr</p>' );
|
|
|
} );
|
|
|
|
|
|
it( 'attaches modifySelection default listener', () => {
|
|
|
- setData( document, 'main', '<p>foo<selection />bar</p>' );
|
|
|
+ setData( document, '<p>foo<selection />bar</p>' );
|
|
|
|
|
|
composer.fire( 'modifySelection', {
|
|
|
selection: document.selection,
|
|
|
@@ -57,7 +57,7 @@ describe( 'Composer', () => {
|
|
|
}
|
|
|
} );
|
|
|
|
|
|
- expect( getData( document, 'main', { selection: true } ) )
|
|
|
+ expect( getData( document, { withSelection: true } ) )
|
|
|
.to.equal( '<p>fo<selection backward>o</selection>bar</p>' );
|
|
|
} );
|
|
|
} );
|