8
0
Quellcode durchsuchen

Added tests to core.treeView.Text#clone method.

Szymon Kupś vor 9 Jahren
Ursprung
Commit
11106a85f2
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  1. 10 0
      packages/ckeditor5-engine/tests/treeview/text.js

+ 10 - 0
packages/ckeditor5-engine/tests/treeview/text.js

@@ -21,6 +21,16 @@ describe( 'Element', () => {
 		} );
 	} );
 
+	describe( 'clone', () => {
+		it( 'should return new text with same data', () => {
+			const text = new ViewText( 'foo bar' );
+			const clone = text.clone();
+
+			expect( clone ).to.not.equal( text );
+			expect( clone.data ).to.equal( text.data );
+		} );
+	} );
+
 	describe( 'setText', () => {
 		it( 'should change the text', () => {
 			const text = new ViewText( 'foo' );