Explorar o código

A unit test that covers the new change.

Kamil Piechaczek %!s(int64=5) %!d(string=hai) anos
pai
achega
a3f4160980
Modificáronse 1 ficheiros con 29 adicións e 0 borrados
  1. 29 0
      packages/ckeditor5-paste-from-office/tests/filters/list.js

+ 29 - 0
packages/ckeditor5-paste-from-office/tests/filters/list.js

@@ -181,6 +181,35 @@ describe( 'PasteFromOffice - filters', () => {
 							'</li>' +
 						'</ol>' );
 				} );
+
+				it( 'handles indentation for nested lists with different the `mso-list-id` value', () => {
+					const html = '<p style="mso-list:l0 level1 lfo0">Foo 1</p><p style="mso-list:l1 level2 lfo0">Bar 1.1</p>';
+					const view = htmlDataProcessor.toView( html );
+
+					const styles = '@list l0\n' +
+						'{ mso-list-id: 111; }\n' +
+						'@list l0:level1\n' +
+						'{ mso-level-number-format: alpha-upper; }\n' +
+						'@list l1' +
+						'{ mso-list-id:222; }' +
+						'@list l1:level1\n' +
+						'{ mso-level-number-format: bullet; }' +
+						'@list l1:level2\n' +
+						'{ mso-level-number-format: bullet; }';
+
+					transformListItemLikeElementsIntoLists( view, styles );
+
+					expect( view.childCount ).to.equal( 1 );
+					expect( stringify( view ) ).to.equal(
+						'<ol style="list-style-type:upper-alpha">' +
+							'<li style="mso-list:l0 level1 lfo0">Foo 1' +
+								'<ul>' +
+									'<li style="mso-list:l1 level2 lfo0">Bar 1.1</li>' +
+								'</ul>' +
+							'</li>' +
+						'</ol>'
+					);
+				} );
 			} );
 
 			describe( 'list styles', () => {