Răsfoiți Sursa

Merge branch t/ckeditor5-list/103

Internal: Aligned tests to changes in ckeditor/ckeditor5-list#103.
Piotrek Koszuliński 7 ani în urmă
părinte
comite
044c1159cc

+ 2 - 2
packages/ckeditor5-engine/src/model/schema.js

@@ -1047,7 +1047,7 @@ mix( Schema, ObservableMixin );
  *
  *		schema.register( 'listItem', {
  *			inheritAllFrom: '$block',
- *			allowAttributes: [ 'type', 'indent' ]
+ *			allowAttributes: [ 'listType', 'listIndent' ]
  *		} );
  *
  * Which translates to:
@@ -1057,7 +1057,7 @@ mix( Schema, ObservableMixin );
  *			allowContentOf: '$block',
  *			allowAttributesOf: '$block',
  *			inheritTypesFrom: '$block',
- *			allowAttributes: [ 'type', 'indent' ]
+ *			allowAttributes: [ 'listType', 'listIndent' ]
  *		} );
  *
  * # Tips

+ 2 - 2
packages/ckeditor5-engine/tests/dev-utils/enableenginedebug.js

@@ -634,7 +634,7 @@ describe( 'debug tools', () => {
 				new ModelElement( 'paragraph', { foo: 'bar' }, [
 					new ModelText( 'This is ' ), new ModelText( 'bold', { bold: true } ), new ModelText( '.' )
 				] ),
-				new ModelElement( 'listItem', { type: 'numbered', indent: 0 }, new ModelText( 'One.' ) ),
+				new ModelElement( 'listItem', { listType: 'numbered', listIndent: 0 }, new ModelText( 'One.' ) ),
 			] );
 
 			const modelRootTree = modelRoot.printTree();
@@ -646,7 +646,7 @@ describe( 'debug tools', () => {
 				'\n\t\t<$text bold=true>bold</$text>' +
 				'\n\t\t.' +
 				'\n\t</paragraph>' +
-				'\n\t<listItem type="numbered" indent=0>' +
+				'\n\t<listItem listType="numbered" listIndent=0>' +
 				'\n\t\tOne.' +
 				'\n\t</listItem>' +
 				'\n</main>'

+ 9 - 9
packages/ckeditor5-engine/tests/model/schema.js

@@ -2270,7 +2270,7 @@ describe( 'Schema', () => {
 			() => {
 				schema.register( 'listItem', {
 					inheritAllFrom: '$block',
-					allowAttributes: [ 'indent', 'type' ]
+					allowAttributes: [ 'listIndent', 'listType' ]
 				} );
 			},
 			() => {
@@ -2351,11 +2351,11 @@ describe( 'Schema', () => {
 			root1 = new Element( '$root', null, [
 				new Element( 'paragraph', null, 'foo' ),
 				new Element( 'paragraph', { alignment: 'right' }, 'bar' ),
-				new Element( 'listItem', { type: 'x', indent: 0 }, 'foo' ),
+				new Element( 'listItem', { listType: 'x', listIndent: 0 }, 'foo' ),
 				new Element( 'heading1', null, 'foo' ),
 				new Element( 'blockQuote', null, [
 					new Element( 'paragraph', null, 'foo' ),
-					new Element( 'listItem', { type: 'x', indent: 0 }, 'foo' ),
+					new Element( 'listItem', { listType: 'x', listIndent: 0 }, 'foo' ),
 					new Element( 'image', null, [
 						new Element( 'caption', null, 'foo' )
 					] )
@@ -2522,11 +2522,11 @@ describe( 'Schema', () => {
 		} );
 
 		it( 'accepts attribute $root>listItem[indent]', () => {
-			expect( schema.checkAttribute( r1lI, 'indent' ) ).to.be.true;
+			expect( schema.checkAttribute( r1lI, 'listIndent' ) ).to.be.true;
 		} );
 
 		it( 'accepts attribute $root>listItem[type]', () => {
-			expect( schema.checkAttribute( r1lI, 'type' ) ).to.be.true;
+			expect( schema.checkAttribute( r1lI, 'listType' ) ).to.be.true;
 		} );
 
 		it( 'accepts attribute $root>image[src]', () => {
@@ -2542,11 +2542,11 @@ describe( 'Schema', () => {
 		} );
 
 		it( 'rejects attribute $root[indent]', () => {
-			expect( schema.checkAttribute( root1, 'indent' ) ).to.be.false;
+			expect( schema.checkAttribute( root1, 'listIndent' ) ).to.be.false;
 		} );
 
 		it( 'rejects attribute $root>paragraph[indent]', () => {
-			expect( schema.checkAttribute( r1p1, 'indent' ) ).to.be.false;
+			expect( schema.checkAttribute( r1p1, 'listIndent' ) ).to.be.false;
 		} );
 
 		it( 'accepts attribute $root>heading1>$text[bold]', () => {
@@ -2558,7 +2558,7 @@ describe( 'Schema', () => {
 		} );
 
 		it( 'rejects attribute $root>blockQuote[indent]', () => {
-			expect( schema.checkAttribute( r1bQ, 'indent' ) ).to.be.false;
+			expect( schema.checkAttribute( r1bQ, 'listIndent' ) ).to.be.false;
 		} );
 
 		it( 'rejects attribute $root>blockQuote[alignment]', () => {
@@ -2566,7 +2566,7 @@ describe( 'Schema', () => {
 		} );
 
 		it( 'rejects attribute $root>image[indent]', () => {
-			expect( schema.checkAttribute( r1i, 'indent' ) ).to.be.false;
+			expect( schema.checkAttribute( r1i, 'listIndent' ) ).to.be.false;
 		} );
 
 		it( 'rejects attribute $root>image[alignment]', () => {

+ 13 - 13
packages/ckeditor5-engine/tests/model/utils/insertcontent.js

@@ -247,7 +247,7 @@ describe( 'DataController utils', () => {
 				} );
 				schema.register( 'listItem', {
 					inheritAllFrom: '$block',
-					allowAttributes: [ 'type', 'indent' ]
+					allowAttributes: [ 'listType', 'listIndent' ]
 				} );
 			} );
 
@@ -370,40 +370,40 @@ describe( 'DataController utils', () => {
 
 				it( 'inserts one list item', () => {
 					setData( model, '<paragraph>f[]oo</paragraph>' );
-					insertHelper( '<listItem indent="0" type="bulleted">xyz</listItem>' );
+					insertHelper( '<listItem listIndent="0" listType="bulleted">xyz</listItem>' );
 					expect( getData( model ) ).to.equal( '<paragraph>fxyz[]oo</paragraph>' );
 				} );
 
 				it( 'inserts list item to empty element', () => {
 					setData( model, '<paragraph>[]</paragraph>' );
-					insertHelper( '<listItem indent="0" type="bulleted">xyz</listItem>' );
-					expect( getData( model ) ).to.equal( '<listItem indent="0" type="bulleted">xyz[]</listItem>' );
+					insertHelper( '<listItem listIndent="0" listType="bulleted">xyz</listItem>' );
+					expect( getData( model ) ).to.equal( '<listItem listIndent="0" listType="bulleted">xyz[]</listItem>' );
 				} );
 
 				it( 'inserts three list items at the end of paragraph', () => {
 					setData( model, '<paragraph>foo[]</paragraph>' );
 					insertHelper(
-						'<listItem indent="0" type="bulleted">xxx</listItem>' +
-						'<listItem indent="0" type="bulleted">yyy</listItem>' +
-						'<listItem indent="0" type="bulleted">zzz</listItem>'
+						'<listItem listIndent="0" listType="bulleted">xxx</listItem>' +
+						'<listItem listIndent="0" listType="bulleted">yyy</listItem>' +
+						'<listItem listIndent="0" listType="bulleted">zzz</listItem>'
 					);
 					expect( getData( model ) ).to.equal(
 						'<paragraph>fooxxx</paragraph>' +
-						'<listItem indent="0" type="bulleted">yyy</listItem>' +
-						'<listItem indent="0" type="bulleted">zzz[]</listItem>'
+						'<listItem listIndent="0" listType="bulleted">yyy</listItem>' +
+						'<listItem listIndent="0" listType="bulleted">zzz[]</listItem>'
 					);
 				} );
 
 				it( 'inserts two list items to an empty paragraph', () => {
 					setData( model, '<paragraph>a</paragraph><paragraph>[]</paragraph><paragraph>b</paragraph>' );
 					insertHelper(
-						'<listItem indent="0" type="bulleted">xxx</listItem>' +
-						'<listItem indent="0" type="bulleted">yyy</listItem>'
+						'<listItem listIndent="0" listType="bulleted">xxx</listItem>' +
+						'<listItem listIndent="0" listType="bulleted">yyy</listItem>'
 					);
 					expect( getData( model ) ).to.equal(
 						'<paragraph>a</paragraph>' +
-						'<listItem indent="0" type="bulleted">xxx</listItem>' +
-						'<listItem indent="0" type="bulleted">yyy[]</listItem>' +
+						'<listItem listIndent="0" listType="bulleted">xxx</listItem>' +
+						'<listItem listIndent="0" listType="bulleted">yyy[]</listItem>' +
 						'<paragraph>b</paragraph>'
 					);
 				} );