Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

test(ContextMenu): the nested bottom-sheet case waits for its first row (#7761)

Christopher Chedeauecb0468726d8
diff --git a/packages/core/src/ContextMenu/ContextMenu.test.tsx b/packages/core/src/ContextMenu/ContextMenu.test.tsx
index 0668e86b4e..c9f242739b 100644
--- a/packages/core/src/ContextMenu/ContextMenu.test.tsx
+++ b/packages/core/src/ContextMenu/ContextMenu.test.tsx
@@ -273,7 +273,12 @@ describe('ContextMenu', () => {
);
fireEvent.contextMenu(screen.getByText('Right-click me'));
- await user.click(screen.getByRole('button', {name: 'Move to project'}));
+ // The sheet is lazy: its first render suspends once even when the module
+ // is already loaded, so wait for the row rather than relying on an
+ // earlier case to have rendered a sheet.
+ await user.click(
+ await screen.findByRole('button', {name: 'Move to project'}),
+ );
const submenuHeading = screen.getByRole('heading', {
name: 'Move to project',