Kaynağa Gözat

Use custom matcher to match balloon add call arguments.

Maciej Gołaszewski 5 yıl önce
ebeveyn
işleme
4f7acf2780

+ 3 - 4
packages/ckeditor5-image/tests/imagetoolbar.js

@@ -83,10 +83,9 @@ describe( 'ImageToolbar', () => {
 
 			setData( model, '[<image src=""></image>]' );
 
-			sinon.assert.calledWithMatch( spy, {
-				view: toolbar,
-				balloonClassName: 'ck-toolbar-container'
-			} );
+			sinon.assert.calledWithMatch( spy, sinon.match( ( { balloonClassName, view } ) => {
+				return view === toolbar && balloonClassName === 'ck-toolbar-container';
+			} ) );
 		} );
 
 		it( 'should set aria-label attribute', () => {

+ 3 - 4
packages/ckeditor5-media-embed/tests/mediaembedtoolbar.js

@@ -63,10 +63,9 @@ describe( 'MediaEmbedToolbar', () => {
 
 			setData( model, '[<media url=""></media>]' );
 
-			sinon.assert.calledWithMatch( spy, {
-				view: toolbar,
-				balloonClassName: 'ck-toolbar-container'
-			} );
+			sinon.assert.calledWithMatch( spy, sinon.match( ( { balloonClassName, view } ) => {
+				return view === toolbar && balloonClassName === 'ck-toolbar-container';
+			} ) );
 		} );
 
 		it( 'should set aria-label attribute', () => {

+ 6 - 8
packages/ckeditor5-table/tests/tabletoolbar.js

@@ -89,10 +89,9 @@ describe( 'TableToolbar', () => {
 
 				setData( model, '<table><tableRow><tableCell>[]</tableCell></tableRow></table>' );
 
-				sinon.assert.calledWithMatch( spy, {
-					view: toolbar,
-					balloonClassName: 'ck-toolbar-container'
-				} );
+				sinon.assert.calledWithMatch( spy, sinon.match( ( { balloonClassName, view } ) => {
+					return view === toolbar && balloonClassName === 'ck-toolbar-container';
+				} ) );
 			} );
 
 			it( 'should set aria-label attribute', () => {
@@ -301,10 +300,9 @@ describe( 'TableToolbar', () => {
 
 				setData( model, '[<table><tableRow><tableCell></tableCell></tableRow></table>]' );
 
-				sinon.assert.calledWithMatch( spy, {
-					view: toolbar,
-					balloonClassName: 'ck-toolbar-container'
-				} );
+				sinon.assert.calledWithMatch( spy, sinon.match( ( { balloonClassName, view } ) => {
+					return view === toolbar && balloonClassName === 'ck-toolbar-container';
+				} ) );
 			} );
 		} );