Bladeren bron

Test: Added unit test for case where exception would be thrown on removing format from particulary wrapped attributes.

Marek Lewandowski 6 jaren geleden
bovenliggende
commit
d300c29e08
1 gewijzigde bestanden met toevoegingen van 13 en 0 verwijderingen
  1. 13 0
      packages/ckeditor5-remove-format/tests/integration.js

+ 13 - 0
packages/ckeditor5-remove-format/tests/integration.js

@@ -76,4 +76,17 @@ describe( 'RemoveFormat', () => {
 					'[</paragraph><image src="assets/sample.png"><caption>foo</caption></image><paragraph>bar]</paragraph>' );
 		} );
 	} );
+
+	describe( 'Handles correctly known issues', () => {
+		it( 'doesn\'t break after removing subsequently applied style', () => {
+			// https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
+			setModelData( model, '<paragraph>f[o<$text bold="true">ob</$text>a]r</paragraph>' );
+
+			editor.execute( 'underline' );
+
+			editor.execute( 'removeFormat' );
+
+			expect( getModelData( model ) ).to.equal( '<paragraph>foobar</paragraph>' );
+		} );
+	} );
 } );