8
0
Просмотр исходного кода

Add test for top-most block case in indent using classes suite.

Maciej Gołaszewski 6 лет назад
Родитель
Сommit
446f50ab0a
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      packages/ckeditor5-indent/tests/indentblockcommand.js

+ 14 - 0
packages/ckeditor5-indent/tests/indentblockcommand.js

@@ -146,6 +146,20 @@ describe( 'IndentBlockCommand', () => {
 					command.execute();
 					expect( getData( model ) ).to.equal( '<paragraph blockIndent="indent-3">f[]oo</paragraph>' );
 				} );
+
+				it( 'should be executed only for top-most blocks that can have indentBlock attribute', () => {
+					setData( model,
+						'<paragraph>f[oo</paragraph>' +
+						'<parentBlock><paragraph>foo</paragraph><paragraph>foo</paragraph></parentBlock>' +
+						'<paragraph>f]oo</paragraph>'
+					);
+					command.execute();
+					expect( getData( model ) ).to.equal(
+						'<paragraph blockIndent="indent-1">f[oo</paragraph>' +
+						'<parentBlock><paragraph>foo</paragraph><paragraph>foo</paragraph></parentBlock>' +
+						'<paragraph blockIndent="indent-1">f]oo</paragraph>'
+					);
+				} );
 			} );
 		} );