|
@@ -431,7 +431,8 @@ describe( 'DowncastHelpers', () => {
|
|
|
'attribute:classForMain:complex',
|
|
'attribute:classForMain:complex',
|
|
|
'attribute:classForWrap:complex',
|
|
'attribute:classForWrap:complex',
|
|
|
'attribute:attributeToElement:complex',
|
|
'attribute:attributeToElement:complex',
|
|
|
- 'insert:slot'
|
|
|
|
|
|
|
+ 'insert:slot',
|
|
|
|
|
+ 'remove:slot'
|
|
|
]
|
|
]
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -527,6 +528,26 @@ describe( 'DowncastHelpers', () => {
|
|
|
);
|
|
);
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ it( 'should convert element on removing slot', () => {
|
|
|
|
|
+ setModelData( model,
|
|
|
|
|
+ '<complex>' +
|
|
|
|
|
+ '<slot><paragraph>foo</paragraph></slot>' +
|
|
|
|
|
+ '<slot><paragraph>bar</paragraph></slot>' +
|
|
|
|
|
+ '</complex>' );
|
|
|
|
|
+
|
|
|
|
|
+ model.change( writer => {
|
|
|
|
|
+ writer.remove( modelRoot.getChild( 0 ).getChild( 0 ) );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ expectResult(
|
|
|
|
|
+ '<div class="complex-slots">' +
|
|
|
|
|
+ '<div class="slots">' +
|
|
|
|
|
+ '<div class="slot"><p>foo</p></div>' +
|
|
|
|
|
+ '</div>' +
|
|
|
|
|
+ '</div>'
|
|
|
|
|
+ );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
describe( 'memoization', () => {
|
|
describe( 'memoization', () => {
|
|
|
it( 'should create new element on re-converting element', () => {
|
|
it( 'should create new element on re-converting element', () => {
|
|
|
setModelData( model, '<complex>' +
|
|
setModelData( model, '<complex>' +
|