Skip to content

Commit 9df1ada

Browse files
committed
[PR feedback] Address failing EuiHeaderLinks desktop play()
1 parent 893927a commit 9df1ada

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

packages/eui/src/components/header/header_links/header_links.stories.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@ export const Playground: Story = {
4646
</EuiHeaderSection>
4747
</EuiHeader>
4848
),
49-
play: async ({ canvasElement }) => {
49+
play: async ({ canvasElement, step }) => {
5050
const canvas = within(canvasElement);
51-
await waitFor(async () => {
52-
await fireEvent.click(canvas.getByLabelText('Open menu'));
51+
await waitFor(() => canvas.getByLabelText('App menu')); // Wait for rendering to finish
52+
53+
step('Open mobile popover', async () => {
54+
await waitFor(async () => {
55+
const mobilePopover = canvas.queryByLabelText('Open menu');
56+
if (mobilePopover) {
57+
await fireEvent.click(mobilePopover);
58+
await canvas.waitForEuiPopoverVisible();
59+
}
60+
});
5361
});
54-
await canvas.waitForEuiPopoverVisible();
5562
},
5663
};

0 commit comments

Comments
 (0)