|
@@ -2638,6 +2638,29 @@ describe( 'ListEngine', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( 'post fixer', () => {
|
|
describe( 'post fixer', () => {
|
|
|
|
|
+ it( 'should not trigger if change-to-fix is in transparent batch', () => {
|
|
|
|
|
+ // Note that the same example is also tested below in insert suite, however in non-transparent batch.
|
|
|
|
|
+ const input =
|
|
|
|
|
+ '<listItem indent="0" type="bulleted">a</listItem>' +
|
|
|
|
|
+ '[]' +
|
|
|
|
|
+ '<listItem indent="1" type="bulleted">b</listItem>';
|
|
|
|
|
+
|
|
|
|
|
+ const inserted = '<paragraph>x</paragraph>';
|
|
|
|
|
+
|
|
|
|
|
+ const output =
|
|
|
|
|
+ '<listItem indent="0" type="bulleted">a</listItem>' +
|
|
|
|
|
+ '<paragraph>x</paragraph>' +
|
|
|
|
|
+ '<listItem indent="1" type="bulleted">b</listItem>';
|
|
|
|
|
+
|
|
|
|
|
+ setModelData( modelDoc, input );
|
|
|
|
|
+
|
|
|
|
|
+ modelDoc.enqueueChanges( () => {
|
|
|
|
|
+ modelDoc.batch( 'transparent' ).insert( modelDoc.selection.getFirstPosition(), parseModel( inserted, modelDoc.schema ) );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ expect( getModelData( modelDoc, { withoutSelection: true } ) ).to.equal( output );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
describe( 'insert', () => {
|
|
describe( 'insert', () => {
|
|
|
function test( testName, input, inserted, output ) {
|
|
function test( testName, input, inserted, output ) {
|
|
|
it( testName, () => {
|
|
it( testName, () => {
|