浏览代码

update tests

idleb 7 年之前
父节点
当前提交
f07766b081

文件差异内容过多而无法显示
+ 9431 - 0
packages/ckeditor5-basic-styles/package-lock.json


+ 3 - 2
packages/ckeditor5-basic-styles/package.json

@@ -10,9 +10,10 @@
   ],
   "dependencies": {
     "@ckeditor/ckeditor5-core": "^11.0.0",
+    "@ckeditor/ckeditor5-dev-tests": "^13.0.3",
     "@ckeditor/ckeditor5-engine": "^10.2.0",
-    "@ckeditor/ckeditor5-ui": "^11.0.0",
-    "@ckeditor/ckeditor5-theme-lark": "^11.0.0"
+    "@ckeditor/ckeditor5-theme-lark": "^11.0.0",
+    "@ckeditor/ckeditor5-ui": "^11.0.0"
   },
   "devDependencies": {
     "@ckeditor/ckeditor5-cloud-services": "^10.0.2",

+ 1 - 1
packages/ckeditor5-basic-styles/tests/subscript.js

@@ -13,6 +13,6 @@ describe( 'Subscript', () => {
 	} );
 
 	it( 'should be named', () => {
-		expect( Subscript.pluginName ).to.equal( 'Sub' );
+		expect( Subscript.pluginName ).to.equal( 'Subscript' );
 	} );
 } );

+ 9 - 9
packages/ckeditor5-basic-styles/tests/subscript/subscriptediting.js

@@ -35,16 +35,16 @@ describe( 'SubEditing', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
-		expect( model.schema.checkAttribute( [ '$root', '$block', '$text' ], 'sub' ) ).to.be.true;
-		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'sub' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$root', '$block', '$text' ], 'subscript' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'subscript' ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {
-		it( 'should register sub command', () => {
-			const command = editor.commands.get( 'sub' );
+		it( 'should register subscript command', () => {
+			const command = editor.commands.get( 'subscript' );
 
 			expect( command ).to.be.instanceOf( AttributeCommand );
-			expect( command ).to.have.property( 'attributeKey', 'sub' );
+			expect( command ).to.have.property( 'attributeKey', 'subscript' );
 		} );
 	} );
 
@@ -53,7 +53,7 @@ describe( 'SubEditing', () => {
 			editor.setData( '<p><sub>foo</sub>bar</p>' );
 
 			expect( getModelData( model, { withoutSelection: true } ) )
-				.to.equal( '<paragraph><$text sub="true">foo</$text>bar</paragraph>' );
+				.to.equal( '<paragraph><$text subscript="true">foo</$text>bar</paragraph>' );
 
 			expect( editor.getData() ).to.equal( '<p><sub>foo</sub>bar</p>' );
 		} );
@@ -62,7 +62,7 @@ describe( 'SubEditing', () => {
 			editor.setData( '<p><span style="vertical-align: sub;">foo</span>bar</p>' );
 
 			expect( getModelData( model, { withoutSelection: true } ) )
-				.to.equal( '<paragraph><$text sub="true">foo</$text>bar</paragraph>' );
+				.to.equal( '<paragraph><$text subscript="true">foo</$text>bar</paragraph>' );
 
 			expect( editor.getData() ).to.equal( '<p><sub>foo</sub>bar</p>' );
 		} );
@@ -71,7 +71,7 @@ describe( 'SubEditing', () => {
 			editor.setData( '<sub>foo</sub>bar' );
 
 			expect( getModelData( model, { withoutSelection: true } ) )
-				.to.equal( '<paragraph><$text sub="true">foo</$text>bar</paragraph>' );
+				.to.equal( '<paragraph><$text subscript="true">foo</$text>bar</paragraph>' );
 
 			expect( editor.getData() ).to.equal( '<p><sub>foo</sub>bar</p>' );
 		} );
@@ -79,7 +79,7 @@ describe( 'SubEditing', () => {
 
 	describe( 'editing pipeline conversion', () => {
 		it( 'should convert attribute', () => {
-			setModelData( model, '<paragraph><$text sub="true">foo</$text>bar</paragraph>' );
+			setModelData( model, '<paragraph><$text subscript="true">foo</$text>bar</paragraph>' );
 
 			expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<p><sub>foo</sub>bar</p>' );
 		} );

+ 5 - 5
packages/ckeditor5-basic-styles/tests/subscript/subscriptui.js

@@ -29,7 +29,7 @@ describe( 'SubscriptUI', () => {
 			.then( newEditor => {
 				editor = newEditor;
 
-				subView = editor.ui.componentFactory.create( 'sub' );
+				subView = editor.ui.componentFactory.create( 'subscript' );
 			} );
 	} );
 
@@ -44,17 +44,17 @@ describe( 'SubscriptUI', () => {
 		expect( subView.icon ).to.match( /<svg / );
 	} );
 
-	it( 'should execute sub command on model execute event', () => {
+	it( 'should execute subscript command on model execute event', () => {
 		const executeSpy = testUtils.sinon.spy( editor, 'execute' );
 
 		subView.fire( 'execute' );
 
 		sinon.assert.calledOnce( executeSpy );
-		sinon.assert.calledWithExactly( executeSpy, 'sub' );
+		sinon.assert.calledWithExactly( executeSpy, 'subscript' );
 	} );
 
-	it( 'should bind model to sub command', () => {
-		const command = editor.commands.get( 'sub' );
+	it( 'should bind model to subscript command', () => {
+		const command = editor.commands.get( 'subscript' );
 
 		expect( subView.isOn ).to.be.false;
 		expect( subView.isEnabled ).to.be.true;

+ 1 - 1
packages/ckeditor5-basic-styles/tests/superscript.js

@@ -13,6 +13,6 @@ describe( 'Superscript', () => {
 	} );
 
 	it( 'should be named', () => {
-		expect( Superscript.pluginName ).to.equal( 'Super' );
+		expect( Superscript.pluginName ).to.equal( 'Superscript' );
 	} );
 } );

+ 10 - 10
packages/ckeditor5-basic-styles/tests/superscript/superscriptediting.js

@@ -35,25 +35,25 @@ describe( 'SuperEditing', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
-		expect( model.schema.checkAttribute( [ '$root', '$block', '$text' ], 'super' ) ).to.be.true;
-		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'super' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$root', '$block', '$text' ], 'superscript' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'superscript' ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {
-		it( 'should register super command', () => {
-			const command = editor.commands.get( 'super' );
+		it( 'should register superscript command', () => {
+			const command = editor.commands.get( 'superscript' );
 
 			expect( command ).to.be.instanceOf( AttributeCommand );
-			expect( command ).to.have.property( 'attributeKey', 'super' );
+			expect( command ).to.have.property( 'attributeKey', 'superscript' );
 		} );
 	} );
 
 	describe( 'data pipeline conversions', () => {
-		it( 'should convert <sup> to super attribute', () => {
+		it( 'should convert <sup> to superscript attribute', () => {
 			editor.setData( '<p><sup>foo</sup>bar</p>' );
 
 			expect( getModelData( model, { withoutSelection: true } ) )
-				.to.equal( '<paragraph><$text super="true">foo</$text>bar</paragraph>' );
+				.to.equal( '<paragraph><$text superscript="true">foo</$text>bar</paragraph>' );
 
 			expect( editor.getData() ).to.equal( '<p><sup>foo</sup>bar</p>' );
 		} );
@@ -62,7 +62,7 @@ describe( 'SuperEditing', () => {
 			editor.setData( '<p><span style="vertical-align: super;">foo</span>bar</p>' );
 
 			expect( getModelData( model, { withoutSelection: true } ) )
-				.to.equal( '<paragraph><$text super="true">foo</$text>bar</paragraph>' );
+				.to.equal( '<paragraph><$text superscript="true">foo</$text>bar</paragraph>' );
 
 			expect( editor.getData() ).to.equal( '<p><sup>foo</sup>bar</p>' );
 		} );
@@ -71,7 +71,7 @@ describe( 'SuperEditing', () => {
 			editor.setData( '<sup>foo</sup>bar' );
 
 			expect( getModelData( model, { withoutSelection: true } ) )
-				.to.equal( '<paragraph><$text super="true">foo</$text>bar</paragraph>' );
+				.to.equal( '<paragraph><$text superscript="true">foo</$text>bar</paragraph>' );
 
 			expect( editor.getData() ).to.equal( '<p><sup>foo</sup>bar</p>' );
 		} );
@@ -79,7 +79,7 @@ describe( 'SuperEditing', () => {
 
 	describe( 'editing pipeline conversion', () => {
 		it( 'should convert attribute', () => {
-			setModelData( model, '<paragraph><$text super="true">foo</$text>bar</paragraph>' );
+			setModelData( model, '<paragraph><$text superscript="true">foo</$text>bar</paragraph>' );
 
 			expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<p><sup>foo</sup>bar</p>' );
 		} );

+ 5 - 5
packages/ckeditor5-basic-styles/tests/superscript/superscriptui.js

@@ -29,7 +29,7 @@ describe( 'SuperscriptUI', () => {
 			.then( newEditor => {
 				editor = newEditor;
 
-				superView = editor.ui.componentFactory.create( 'super' );
+				superView = editor.ui.componentFactory.create( 'superscript' );
 			} );
 	} );
 
@@ -44,17 +44,17 @@ describe( 'SuperscriptUI', () => {
 		expect( superView.icon ).to.match( /<svg / );
 	} );
 
-	it( 'should execute super command on model execute event', () => {
+	it( 'should execute superscript command on model execute event', () => {
 		const executeSpy = testUtils.sinon.spy( editor, 'execute' );
 
 		superView.fire( 'execute' );
 
 		sinon.assert.calledOnce( executeSpy );
-		sinon.assert.calledWithExactly( executeSpy, 'super' );
+		sinon.assert.calledWithExactly( executeSpy, 'superscript' );
 	} );
 
-	it( 'should bind model to super command', () => {
-		const command = editor.commands.get( 'super' );
+	it( 'should bind model to superscript command', () => {
+		const command = editor.commands.get( 'superscript' );
 
 		expect( superView.isOn ).to.be.false;
 		expect( superView.isEnabled ).to.be.true;