Bläddra i källkod

Move test code around.

Maciej Gołaszewski 6 år sedan
förälder
incheckning
915433c465
1 ändrade filer med 38 tillägg och 38 borttagningar
  1. 38 38
      packages/ckeditor5-engine/tests/model/utils/selection-post-fixer.js

+ 38 - 38
packages/ckeditor5-engine/tests/model/utils/selection-post-fixer.js

@@ -100,7 +100,7 @@ describe( 'Selection post-fixer', () => {
 			expect( getModelData( model ) ).to.equal( '<paragraph>foo[]</paragraph><image></image>' );
 			expect( getModelData( model ) ).to.equal( '<paragraph>foo[]</paragraph><image></image>' );
 		} );
 		} );
 
 
-		describe( 'non-collapsed selection - table scenarios', () => {
+		describe( 'selection - table scenarios', () => {
 			beforeEach( () => {
 			beforeEach( () => {
 				setModelData( model,
 				setModelData( model,
 					'<paragraph>[]foo</paragraph>' +
 					'<paragraph>[]foo</paragraph>' +
@@ -198,6 +198,43 @@ describe( 'Selection post-fixer', () => {
 				);
 				);
 			} );
 			} );
 
 
+			it( 'should fix #5 - collapsed selection between tables', () => {
+				setModelData( model,
+					'<paragraph>foo</paragraph>' +
+					'<table>' +
+						'<tableRow>' +
+							'<tableCell><paragraph>aaa</paragraph></tableCell>' +
+							'<tableCell><paragraph>bbb</paragraph></tableCell>' +
+						'</tableRow>' +
+					'</table>' +
+					'[]' +
+					'<table>' +
+						'<tableRow>' +
+							'<tableCell><paragraph>xxx</paragraph></tableCell>' +
+							'<tableCell><paragraph>yyy</paragraph></tableCell>' +
+						'</tableRow>' +
+					'</table>' +
+					'<paragraph>baz</paragraph>'
+				);
+
+				assertEqualMarkup( getModelData( model ),
+					'<paragraph>foo</paragraph>' +
+					'[<table>' +
+						'<tableRow>' +
+							'<tableCell><paragraph>aaa</paragraph></tableCell>' +
+							'<tableCell><paragraph>bbb</paragraph></tableCell>' +
+						'</tableRow>' +
+					'</table>]' +
+					'<table>' +
+						'<tableRow>' +
+							'<tableCell><paragraph>xxx</paragraph></tableCell>' +
+							'<tableCell><paragraph>yyy</paragraph></tableCell>' +
+						'</tableRow>' +
+					'</table>' +
+					'<paragraph>baz</paragraph>'
+				);
+			} );
+
 			// There's a chance that this and the following test will not be up to date with
 			// There's a chance that this and the following test will not be up to date with
 			// how the table feature is really implemented once we'll introduce row/cells/columns selection
 			// how the table feature is really implemented once we'll introduce row/cells/columns selection
 			// in which case all these elements will need to be marked as objects.
 			// in which case all these elements will need to be marked as objects.
@@ -1095,43 +1132,6 @@ describe( 'Selection post-fixer', () => {
 					'<paragraph>bar</paragraph>'
 					'<paragraph>bar</paragraph>'
 				);
 				);
 			} );
 			} );
-
-			it( 'should fix selection between tables', () => {
-				setModelData( model,
-					'<paragraph>foo</paragraph>' +
-					'<table>' +
-						'<tableRow>' +
-							'<tableCell><paragraph>aaa</paragraph></tableCell>' +
-							'<tableCell><paragraph>bbb</paragraph></tableCell>' +
-						'</tableRow>' +
-					'</table>' +
-					'[]' +
-					'<table>' +
-						'<tableRow>' +
-							'<tableCell><paragraph>xxx</paragraph></tableCell>' +
-							'<tableCell><paragraph>yyy</paragraph></tableCell>' +
-						'</tableRow>' +
-					'</table>' +
-					'<paragraph>baz</paragraph>'
-				);
-
-				assertEqualMarkup( getModelData( model ),
-					'<paragraph>foo</paragraph>' +
-					'[<table>' +
-						'<tableRow>' +
-							'<tableCell><paragraph>aaa</paragraph></tableCell>' +
-							'<tableCell><paragraph>bbb</paragraph></tableCell>' +
-						'</tableRow>' +
-					'</table>]' +
-					'<table>' +
-						'<tableRow>' +
-							'<tableCell><paragraph>xxx</paragraph></tableCell>' +
-							'<tableCell><paragraph>yyy</paragraph></tableCell>' +
-						'</tableRow>' +
-					'</table>' +
-					'<paragraph>baz</paragraph>'
-				);
-			} );
 		} );
 		} );
 	} );
 	} );
 } );
 } );