8
0
Просмотр исходного кода

Improve test to match exactly thrown error.

Mateusz Samsel 6 лет назад
Родитель
Сommit
069cf7be28
1 измененных файлов с 13 добавлено и 3 удалено
  1. 13 3
      packages/ckeditor5-editor-inline/tests/inlineeditor.js

+ 13 - 3
packages/ckeditor5-editor-inline/tests/inlineeditor.js

@@ -154,9 +154,19 @@ describe( 'InlineEditor', () => {
 			InlineEditor.create( '<p>Hello world!</p>', {
 				initialData: '<p>I am evil!</p>',
 				plugins: [ Paragraph ]
-			} ).catch( () => {
-				done();
-			} );
+			} )
+				.then(
+					() => {
+						expect.fail( 'Inline editor should throw an error when both initial data are passed' );
+					},
+					err => {
+						expect( err ).to.be.an( 'error' ).with.property( 'message' ).and
+							// eslint-disable-next-line max-len
+							.match( /^editor-create-initial-data: The config\.initialData option cannot be used together with initial data passed in Editor\.create\(\)\./ );
+					}
+				)
+				.then( done )
+				.catch( done );
 		} );
 
 		// #25