Skip to content

Commit 5426699

Browse files
committed
feat(metadata-view): bulk custom actions
Switch await pattern
1 parent dff6a41 commit 5426699

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/elements/common/sub-header/__tests__/SubHeaderRight.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ describe('elements/common/sub-header/SubHeaderRight', () => {
140140
);
141141

142142
const ellipsisButton = await screen.findByRole('button', { name: 'Bulk actions' });
143-
user.click(ellipsisButton);
143+
await user.click(ellipsisButton);
144144

145-
const downloadAction = await screen.findByRole('menuitem', { name: 'Download' });
145+
const downloadAction = screen.getByRole('menuitem', { name: 'Download' });
146146
await user.click(downloadAction);
147147

148148
const expectedOnClickArgument = 'all';

src/elements/content-explorer/__tests__/ContentExplorer.test.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,14 +526,13 @@ describe('elements/content-explorer/ContentExplorer', () => {
526526
const firstRow = await screen.findByRole('row', { name: /Child 2/i });
527527
expect(firstRow).toBeInTheDocument();
528528

529-
const checkbox = within(firstRow).getByRole('checkbox');
530-
userEvent.click(checkbox);
529+
await userEvent.click(within(firstRow).getByRole('checkbox'));
531530

532-
const ellipsisButton = await screen.findByRole('button', { name: 'Bulk actions' });
533-
expect(ellipsisButton).toBeInTheDocument();
534-
userEvent.click(ellipsisButton);
531+
const bulkActionsButton = screen.getByRole('button', { name: 'Bulk actions' });
532+
expect(bulkActionsButton).toBeInTheDocument();
533+
await userEvent.click(bulkActionsButton);
535534

536-
const downloadAction = await screen.findByRole('menuitem', { name: 'Download' });
535+
const downloadAction = screen.getByRole('menuitem', { name: 'Download' });
537536
expect(downloadAction).toBeInTheDocument();
538537
await userEvent.click(downloadAction);
539538

0 commit comments

Comments
 (0)