Преглед на файлове

Tests: Make sure that the default behavior is prevented.

Marek Lewandowski преди 5 години
родител
ревизия
fa9b5094c7
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      packages/ckeditor5-table/tests/tableclipboard.js

+ 5 - 1
packages/ckeditor5-table/tests/tableclipboard.js

@@ -362,6 +362,8 @@ describe( 'table clipboard', () => {
 			} );
 
 			it( 'should be disabled in a readonly mode', () => {
+				const preventDefaultStub = sinon.stub();
+
 				editor.isReadOnly = true;
 
 				tableSelection._setCellSelection(
@@ -371,7 +373,7 @@ describe( 'table clipboard', () => {
 
 				const data = {
 					dataTransfer: createDataTransfer(),
-					preventDefault: sinon.spy()
+					preventDefault: preventDefaultStub
 				};
 				viewDocument.fire( 'cut', data );
 
@@ -383,6 +385,8 @@ describe( 'table clipboard', () => {
 					[ '10', '11', '12' ],
 					[ '20', '21', '22' ]
 				] ) );
+
+				sinon.assert.calledOnce( preventDefaultStub );
 			} );
 		} );
 	} );