|
|
@@ -1307,7 +1307,7 @@ describe( 'Selection', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
- describe( 'isEntireContentSelected()', () => {
|
|
|
+ describe( 'containsEntireContent()', () => {
|
|
|
beforeEach( () => {
|
|
|
doc.schema.registerItem( 'p', '$block' );
|
|
|
doc.schema.allow( { name: 'p', inside: '$root' } );
|
|
|
@@ -1316,13 +1316,13 @@ describe( 'Selection', () => {
|
|
|
it( 'returns true if the entire content in $root is selected', () => {
|
|
|
setData( doc, '<p>[Foo</p><p>Bom</p><p>Bar]</p>' );
|
|
|
|
|
|
- expect( doc.selection.isEntireContentSelected() ).to.equal( true );
|
|
|
+ expect( doc.selection.containsEntireContent() ).to.equal( true );
|
|
|
} );
|
|
|
|
|
|
it( 'returns false when only a fragment of the content in $root is selected', () => {
|
|
|
setData( doc, '<p>Fo[o</p><p>Bom</p><p>Bar]</p>' );
|
|
|
|
|
|
- expect( doc.selection.isEntireContentSelected() ).to.equal( false );
|
|
|
+ expect( doc.selection.containsEntireContent() ).to.equal( false );
|
|
|
} );
|
|
|
|
|
|
it( 'returns true if the entire content in specified element is selected', () => {
|
|
|
@@ -1331,7 +1331,7 @@ describe( 'Selection', () => {
|
|
|
const root = doc.getRoot();
|
|
|
const secondParagraph = root.getNodeByPath( [ 1 ] );
|
|
|
|
|
|
- expect( doc.selection.isEntireContentSelected( secondParagraph ) ).to.equal( true );
|
|
|
+ expect( doc.selection.containsEntireContent( secondParagraph ) ).to.equal( true );
|
|
|
} );
|
|
|
|
|
|
it( 'returns false if the entire content in specified element is not selected', () => {
|
|
|
@@ -1340,7 +1340,7 @@ describe( 'Selection', () => {
|
|
|
const root = doc.getRoot();
|
|
|
const secondParagraph = root.getNodeByPath( [ 1 ] );
|
|
|
|
|
|
- expect( doc.selection.isEntireContentSelected( secondParagraph ) ).to.equal( false );
|
|
|
+ expect( doc.selection.containsEntireContent( secondParagraph ) ).to.equal( false );
|
|
|
} );
|
|
|
|
|
|
it( 'returns false when the entire content except an empty element is selected', () => {
|
|
|
@@ -1349,19 +1349,19 @@ describe( 'Selection', () => {
|
|
|
|
|
|
setData( doc, '<p><img></img>[Foo]</p>' );
|
|
|
|
|
|
- expect( doc.selection.isEntireContentSelected() ).to.equal( false );
|
|
|
+ expect( doc.selection.containsEntireContent() ).to.equal( false );
|
|
|
} );
|
|
|
|
|
|
it( 'returns true if the content is empty', () => {
|
|
|
setData( doc, '[]' );
|
|
|
|
|
|
- expect( doc.selection.isEntireContentSelected() ).to.equal( true );
|
|
|
+ expect( doc.selection.containsEntireContent() ).to.equal( true );
|
|
|
} );
|
|
|
|
|
|
it( 'returns false if empty selection is at the end of non-empty content', () => {
|
|
|
setData( doc, '<p>Foo bar bom.</p>[]' );
|
|
|
|
|
|
- expect( doc.selection.isEntireContentSelected() ).to.equal( false );
|
|
|
+ expect( doc.selection.containsEntireContent() ).to.equal( false );
|
|
|
} );
|
|
|
} );
|
|
|
} );
|