Skip to content

Commit

Permalink
Fixed failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
niegowski committed Dec 5, 2023
1 parent 1faabf2 commit a809c47
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ describe( 'CKBoxImageEditCommand', () => {
sinon.assert.calledOnce( focusSpy );
} );

it( 'should refresh the command after closing the CKBox Image Editor dialog', () => {
it( 'should refresh the command after closing the CKBox Image Editor dialog', async () => {
const ckboxImageId = 'example-id';

setModelData( model,
Expand All @@ -348,11 +348,11 @@ describe( 'CKBoxImageEditCommand', () => {

const imageElement = editor.model.document.selection.getSelectedElement();

const onClose = command._prepareOptions( {
const options = await command._prepareOptions( {
element: imageElement,
ckboxImageId,
controller: new AbortController()
} ).onClose;
} );

const refreshSpy = testUtils.sinon.spy( command, 'refresh' );

Expand All @@ -361,7 +361,7 @@ describe( 'CKBoxImageEditCommand', () => {
command.execute();
expect( command.value ).to.be.true;

onClose();
options.onClose();
expect( command.value ).to.be.false;
sinon.assert.calledOnce( refreshSpy );
} );
Expand Down

0 comments on commit a809c47

Please sign in to comment.