ソースを参照

Second batch of changes updating schema use to match the new API.

Piotrek Koszuliński 8 年 前
コミット
b7ea755bb1

+ 3 - 3
packages/ckeditor5-basic-styles/tests/boldengine.js

@@ -35,9 +35,9 @@ describe( 'BoldEngine', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
-		expect( model.schema.check( { name: '$text', attributes: 'bold', inside: '$root' } ) ).to.be.false;
-		expect( model.schema.check( { name: '$text', attributes: 'bold', inside: '$block' } ) ).to.be.true;
-		expect( model.schema.check( { name: '$text', attributes: 'bold', inside: '$clipboardHolder' } ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$root', '$text' ], 'bold' ) ).to.be.false;
+		expect( model.schema.checkAttribute( [ '$block', '$text' ], 'bold' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'bold' ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {

+ 3 - 3
packages/ckeditor5-basic-styles/tests/codeengine.js

@@ -35,9 +35,9 @@ describe( 'CodeEngine', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
-		expect( model.schema.check( { name: '$text', attributes: 'code', inside: '$root' } ) ).to.be.false;
-		expect( model.schema.check( { name: '$text', attributes: 'code', inside: '$block' } ) ).to.be.true;
-		expect( model.schema.check( { name: '$text', attributes: 'code', inside: '$clipboardHolder' } ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$root', '$text' ], 'code' ) ).to.be.false;
+		expect( model.schema.checkAttribute( [ '$block', '$text' ], 'code' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'code' ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {

+ 3 - 3
packages/ckeditor5-basic-styles/tests/italicengine.js

@@ -35,9 +35,9 @@ describe( 'ItalicEngine', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
-		expect( model.schema.check( { name: '$text', attributes: 'italic', inside: '$root' } ) ).to.be.false;
-		expect( model.schema.check( { name: '$text', attributes: 'italic', inside: '$block' } ) ).to.be.true;
-		expect( model.schema.check( { name: '$text', attributes: 'italic', inside: '$clipboardHolder' } ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$root', '$text' ], 'italic' ) ).to.be.false;
+		expect( model.schema.checkAttribute( [ '$block', '$text' ], 'italic' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'italic' ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {

+ 3 - 3
packages/ckeditor5-basic-styles/tests/strikethroughengine.js

@@ -35,9 +35,9 @@ describe( 'StrikethroughEngine', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
-		expect( model.schema.check( { name: '$text', attributes: 'strikethrough', inside: '$root' } ) ).to.be.false;
-		expect( model.schema.check( { name: '$text', attributes: 'strikethrough', inside: '$block' } ) ).to.be.true;
-		expect( model.schema.check( { name: '$text', attributes: 'strikethrough', inside: '$clipboardHolder' } ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$root', '$text' ], 'strikethrough' ) ).to.be.false;
+		expect( model.schema.checkAttribute( [ '$block', '$text' ], 'strikethrough' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'strikethrough' ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {

+ 3 - 3
packages/ckeditor5-basic-styles/tests/underlineengine.js

@@ -35,9 +35,9 @@ describe( 'UnderlineEngine', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
-		expect( model.schema.check( { name: '$text', attributes: 'underline', inside: '$root' } ) ).to.be.false;
-		expect( model.schema.check( { name: '$text', attributes: 'underline', inside: '$block' } ) ).to.be.true;
-		expect( model.schema.check( { name: '$text', attributes: 'underline', inside: '$clipboardHolder' } ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$root', '$text' ], 'underline' ) ).to.be.false;
+		expect( model.schema.checkAttribute( [ '$block', '$text' ], 'underline' ) ).to.be.true;
+		expect( model.schema.checkAttribute( [ '$clipboardHolder', '$text' ], 'underline' ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {