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

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

@@ -85,6 +85,21 @@ describe( 'IndentBlockCommand', () => {
 					setData( model, '<block>f[]oo</block>' );
 					setData( model, '<block>f[]oo</block>' );
 					expect( command.isEnabled ).to.be.false;
 					expect( command.isEnabled ).to.be.false;
 				} );
 				} );
+
+				it( 'should be true in non-indented block', () => {
+					setData( model, '<paragraph>f[]oo</paragraph>' );
+					expect( command.isEnabled ).to.be.true;
+				} );
+
+				it( 'should be true in indented block', () => {
+					setData( model, '<paragraph indent="50px">f[]oo</paragraph>' );
+					expect( command.isEnabled ).to.be.true;
+				} );
+
+				it( 'should be true in indented block with different unit', () => {
+					setData( model, '<paragraph indent="2em">f[]oo</paragraph>' );
+					expect( command.isEnabled ).to.be.false;
+				} );
 			} );
 			} );
 
 
 			describe( 'execute()', () => {} );
 			describe( 'execute()', () => {} );
@@ -144,6 +159,21 @@ describe( 'IndentBlockCommand', () => {
 					setData( model, '<block>f[]oo</block>' );
 					setData( model, '<block>f[]oo</block>' );
 					expect( command.isEnabled ).to.be.false;
 					expect( command.isEnabled ).to.be.false;
 				} );
 				} );
+
+				it( 'should be false in non-indented block', () => {
+					setData( model, '<paragraph>f[]oo</paragraph>' );
+					expect( command.isEnabled ).to.be.true;
+				} );
+
+				it( 'should be true in indented block', () => {
+					setData( model, '<paragraph indent="50px">f[]oo</paragraph>' );
+					expect( command.isEnabled ).to.be.true;
+				} );
+
+				it( 'should be true in indented block with different unit', () => {
+					setData( model, '<paragraph indent="2em">f[]oo</paragraph>' );
+					expect( command.isEnabled ).to.be.false;
+				} );
 			} );
 			} );
 
 
 			describe( 'execute()', () => {} );
 			describe( 'execute()', () => {} );