Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
fix: Fix broken tests after changes made
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed Jan 8, 2024
1 parent c720f64 commit 83a24fe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/library-authoring/author-library/LibraryAuthoringPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,15 @@ export const BlockPreviewBase = ({
/>
<OverlayTrigger
placement="top"
overlay={
<Tooltip id="more-actions-tooltip">More Actions</Tooltip>
}
overlay={(
<Tooltip id="more-actions-tooltip">
{intl.formatMessage(messages['library.detail.block.more_actions'])}
</Tooltip>
)}
>
<Dropdown>
<Dropdown.Toggle
aria-label={intl.formatMessage(messages['library.detail.block.more_actions'])}
as={IconButton}
src={MoreVert}
iconAs={Icon}
Expand Down
5 changes: 5 additions & 0 deletions src/library-authoring/author-library/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ const messages = defineMessages({
defaultMessage: 'Manage tags',
description: 'Aria label for manage tags button',
},
'library.detail.block.more_actions': {
id: 'library.detail.block.more_actions',
defaultMessage: 'More actions',
description: 'Aria label for more actions button',
},
'library.detail.block.copy': {
id: 'library.detail.block.copy',
defaultMessage: 'Copy',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,16 @@ testSuite('<LibraryAuthoringPageContainer />', () => {
const library = libraryFactory();
const block = blockFactory(undefined, { library });
await render(library, genState(library, [block]));
const del = screen.getByLabelText('Delete');
const moreActionsButton = screen.getByLabelText('More actions');
act(() => {
del.click();
moreActionsButton.click();
});
const yes = await screen.findByText('Delete');
const deleteAction = await screen.getByLabelText('Delete');
act(() => {
deleteAction.click();
});
const deleteElems = await screen.findAllByText('Delete');
const yes = deleteElems[0];
act(() => {
yes.click();
});
Expand Down

0 comments on commit 83a24fe

Please sign in to comment.