|
|
@@ -329,12 +329,12 @@ describe( 'UpcastWriter', () => {
|
|
|
} );
|
|
|
|
|
|
describe( 'unwrapElement', () => {
|
|
|
- it( 'should unwrap simple elements', () => {
|
|
|
+ it( 'should unwrap simple element', () => {
|
|
|
const documentFragment = dataprocessor.toView( '<ul><li><p>foo</p></li></ul>' );
|
|
|
const paragraph = documentFragment.getChild( 0 ).getChild( 0 ).getChild( 0 );
|
|
|
- const unwrapStatus = writer.unwrapElement( paragraph );
|
|
|
|
|
|
- expect( unwrapStatus ).to.be.true;
|
|
|
+ writer.unwrapElement( paragraph );
|
|
|
+
|
|
|
expect( dataprocessor.toData( documentFragment ) ).to.equal( '<ul><li>foo</li></ul>' );
|
|
|
} );
|
|
|
|
|
|
@@ -342,18 +342,18 @@ describe( 'UpcastWriter', () => {
|
|
|
const documentFragment = dataprocessor.toView(
|
|
|
'<p><span style="color:red"><strong>foo</strong><a href="example.com">example</a>bar</span></p>' );
|
|
|
const span = documentFragment.getChild( 0 ).getChild( 0 );
|
|
|
- const unwrapStatus = writer.unwrapElement( span );
|
|
|
|
|
|
- expect( unwrapStatus ).to.be.true;
|
|
|
+ writer.unwrapElement( span );
|
|
|
+
|
|
|
expect( dataprocessor.toData( documentFragment ) ).to.equal(
|
|
|
'<p><strong>foo</strong><a href="example.com">example</a>bar</p>' );
|
|
|
} );
|
|
|
|
|
|
- it( 'should not be applied to elements without parent', () => {
|
|
|
+ it( 'should do nothing for elements without parent', () => {
|
|
|
const element = new Element( 'p', null, 'foo' );
|
|
|
- const unwrapStatus = writer.unwrapElement( element );
|
|
|
|
|
|
- expect( unwrapStatus ).to.be.false;
|
|
|
+ writer.unwrapElement( element );
|
|
|
+
|
|
|
expect( dataprocessor.toData( element ) ).to.equal( '<p>foo</p>' );
|
|
|
} );
|
|
|
} );
|