Sfoglia il codice sorgente

Tests: One more TC for code coverage.

Marek Lewandowski 5 anni fa
parent
commit
85e0a34e10
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      packages/ckeditor5-widget/tests/widgetresize.js

+ 11 - 0
packages/ckeditor5-widget/tests/widgetresize.js

@@ -364,6 +364,17 @@ describe( 'WidgetResize', () => {
 			} );
 		} );
 
+		it( 'doesn\'t call options.onCommit in case of no change', () => {
+			createResizer();
+
+			const commitStub = sinon.stub();
+			const domParts = getWidgetDomParts( editor, widget, 'top-left' );
+
+			resizerMouseSimulator.down( editor, domParts.resizeHandle );
+			resizerMouseSimulator.up( editor );
+			expect( commitStub.callCount, 'call count' ).to.be.eql( 0 );
+		} );
+
 		it( 'returns proper value when resize host is different from widget wrapper', () => {
 			createResizer( {
 				unit: undefined,