浏览代码

Fixed: model utils should check schema for attributes.

Szymon Cofalik 9 年之前
父节点
当前提交
d63a6fcad4

+ 2 - 0
packages/ckeditor5-engine/tests/_utils-tests/model.js

@@ -24,8 +24,10 @@ describe( 'model test utils', () => {
 
 		document.schema.registerItem( 'a', '$inline' );
 		document.schema.allow( { name: 'a', inside: '$root' } );
+		document.schema.allow( { name: 'a', inside: '$root', attributes: [ 'bar', 'car', 'foo' ] } );
 		document.schema.registerItem( 'b', '$inline' );
 		document.schema.allow( { name: 'b', inside: '$root' } );
+		document.schema.allow( { name: 'b', inside: '$root', attributes: [ 'barFoo', 'fooBar', 'x' ] } );
 		document.schema.registerItem( 'c', '$inline' );
 		document.schema.allow( { name: 'c', inside: '$root' } );
 		document.schema.registerItem( 'paragraph', '$block' );

+ 1 - 0
packages/ckeditor5-engine/tests/_utils/model.js

@@ -333,6 +333,7 @@ function convertToModelElement() {
 	return ( evt, data, consumable, conversionApi ) => {
 		const schemaQuery = {
 			name: data.input.name,
+			attributes: Array.from( data.input.getAttributeKeys() ),
 			inside: data.context
 		};