Przeglądaj źródła

Internal: Align code to the API changes (selection post-fixer).

Piotrek Koszuliński 7 lat temu
rodzic
commit
10629083b5

+ 13 - 3
packages/ckeditor5-table/tests/tableediting.js

@@ -243,6 +243,16 @@ describe( 'TableEditing', () => {
 			} );
 
 			describe( 'on table widget selected', () => {
+				beforeEach( () => {
+					editor.model.schema.register( 'block', {
+						allowWhere: '$block',
+						allowContentOf: '$block',
+						isObject: true
+					} );
+
+					editor.conversion.elementToElement( { model: 'block', view: 'block' } );
+				} );
+
 				it( 'should move caret to the first table cell on TAB', () => {
 					const spy = sinon.spy();
 
@@ -265,19 +275,19 @@ describe( 'TableEditing', () => {
 					sinon.assert.notCalled( spy );
 				} );
 
-				it( 'shouldn\' do anything on other blocks', () => {
+				it( 'shouldn\'t do anything on other blocks', () => {
 					const spy = sinon.spy();
 
 					editor.editing.view.document.on( 'keydown', spy );
 
-					setModelData( model, '[<paragraph>foo</paragraph>]' );
+					setModelData( model, '[<block>foo</block>]' );
 
 					editor.editing.view.document.fire( 'keydown', domEvtDataStub );
 
 					sinon.assert.notCalled( domEvtDataStub.preventDefault );
 					sinon.assert.notCalled( domEvtDataStub.stopPropagation );
 
-					expect( formatTable( getModelData( model ) ) ).to.equal( '[<paragraph>foo</paragraph>]' );
+					expect( formatTable( getModelData( model ) ) ).to.equal( '[<block>foo</block>]' );
 
 					// Should not cancel event.
 					sinon.assert.calledOnce( spy );

+ 3 - 3
packages/ckeditor5-table/tests/tabletoolbar.js

@@ -123,7 +123,7 @@ describe( 'TableToolbar', () => {
 		} );
 
 		it( 'should show the toolbar on ui#update when the table content is selected', () => {
-			setData( model, '<paragraph>[foo]</paragraph><table><tableRow><tableCell></tableCell></tableRow></table>' );
+			setData( model, '<paragraph>[foo]</paragraph><table><tableRow><tableCell>bar</tableCell></tableRow></table>' );
 
 			expect( balloon.visibleView ).to.be.null;
 
@@ -132,9 +132,9 @@ describe( 'TableToolbar', () => {
 			expect( balloon.visibleView ).to.be.null;
 
 			model.change( writer => {
-				// Select the [<tableCell></tableCell>]
+				// Select the <tableCell>[bar]</tableCell>
 				writer.setSelection(
-					Range.createOn( doc.getRoot().getChild( 1 ).getChild( 0 ).getChild( 0 ) )
+					Range.createOn( doc.getRoot().getChild( 1 ).getChild( 0 ).getChild( 0 ).getChild( 0 ) )
 				);
 			} );