Skip to content

Commit

Permalink
fix: test for shared components
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvente committed Apr 5, 2024
1 parent b5b40b4 commit 989b538
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/editors/sharedComponents/InsertLinkModal/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ describe('InsertLinkModal', () => {
selection: {
getContent: () => '<a href="http://example.com" data-block-id="block123">Sample content</a>',
setContent: jest.fn(),
getRng: jest.fn(),
getNode: jest.fn(),
},
},
},
Expand Down
16 changes: 11 additions & 5 deletions src/editors/sharedComponents/TinyMceWidget/hooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,17 @@ describe('TinyMceEditor hooks', () => {
onAction: toggleLabelFormatting,
}],
]));
expect(addToggleButton.mock.calls).toEqual([
[tinyMCE.buttons.codeBlock, {
icon: 'sourcecode', tooltip: 'Code Block', onAction: toggleCodeFormatting, onSetup: setupCodeFormatting,
}],
]);
expect(addToggleButton.mock.calls).toContainEqual(
expect.arrayContaining([
tinyMCE.buttons.codeBlock,
{
icon: 'sourcecode',
tooltip: 'Code Block',
onAction: toggleCodeFormatting,
onSetup: setupCodeFormatting,
},
]),
);
expect(openImgModal).not.toHaveBeenCalled();
expect(editor.on).toHaveBeenCalled();
});
Expand Down

0 comments on commit 989b538

Please sign in to comment.