Browse Source

Fixed test using getData/setData utilities.

Szymon Kupś 9 years ago
parent
commit
8f9d36a07d

+ 6 - 6
packages/ckeditor5-engine/tests/treemodel/composer/composer.js

@@ -23,18 +23,18 @@ describe( 'Composer', () => {
 
 	describe( 'constructor', () => {
 		it( 'attaches deleteContents default listener', () => {
-			setData( document, 'main', '<p>f<selection>oo</p><p>ba</selection>r</p>' );
+			setData( document, '<p>f<selection>oo</p><p>ba</selection>r</p>' );
 
 			const batch = document.batch();
 
 			composer.fire( 'deleteContents', { batch, selection: document.selection } );
 
-			expect( getData( document, 'main' ) ).to.equal( '<p>f</p><p>r</p>' );
+			expect( getData( document ) ).to.equal( '<p>f</p><p>r</p>' );
 			expect( batch.deltas ).to.not.be.empty;
 		} );
 
 		it( 'attaches deleteContents default listener which passes options', () => {
-			setData( document, 'main', '<p>f<selection>oo</p><p>ba</selection>r</p>' );
+			setData( document, '<p>f<selection>oo</p><p>ba</selection>r</p>' );
 
 			const batch = document.batch();
 
@@ -44,11 +44,11 @@ describe( 'Composer', () => {
 				options: { merge: true }
 			} );
 
-			expect( getData( document, 'main' ) ).to.equal( '<p>fr</p>' );
+			expect( getData( document ) ).to.equal( '<p>fr</p>' );
 		} );
 
 		it( 'attaches modifySelection default listener', () => {
-			setData( document, 'main', '<p>foo<selection />bar</p>' );
+			setData( document, '<p>foo<selection />bar</p>' );
 
 			composer.fire( 'modifySelection', {
 				selection: document.selection,
@@ -57,7 +57,7 @@ describe( 'Composer', () => {
 				}
 			} );
 
-			expect( getData( document, 'main', { selection: true } ) )
+			expect( getData( document, { withSelection: true } ) )
 				.to.equal( '<p>fo<selection backward>o</selection>bar</p>' );
 		} );
 	} );

+ 2 - 2
packages/ckeditor5-engine/tests/treemodel/composer/deletecontents.js

@@ -215,11 +215,11 @@ describe( 'Delete utils', () => {
 
 		function test( title, input, output, options ) {
 			it( title, () => {
-				setData( document, 'main', input );
+				setData( document, input );
 
 				deleteContents( document.batch(), document.selection, options );
 
-				expect( getData( document, 'main', { selection: true } ) ).to.equal( output );
+				expect( getData( document, { withSelection: true } ) ).to.equal( output );
 			} );
 		}
 	} );

+ 2 - 2
packages/ckeditor5-engine/tests/treemodel/composer/modifyselection.js

@@ -229,11 +229,11 @@ describe( 'Delete utils', () => {
 
 	function test( title, input, output, options ) {
 		it( title, () => {
-			setData( document, 'main', input );
+			setData( document, input );
 
 			modifySelection( document.selection, options );
 
-			expect( getData( document, 'main', { selection: true } ) ).to.equal( output );
+			expect( getData( document, { withSelection: true } ) ).to.equal( output );
 		} );
 	}
 } );