Skip to content

Commit c55cce9

Browse files
chore(chromatic): fix snapshots (#3774)
1 parent d09b8cb commit c55cce9

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

src/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ import { DEFAULT_HOSTNAME_API } from '../../../../constants';
1111
export const basic = {
1212
play: async ({ canvasElement }) => {
1313
const canvas = within(canvasElement);
14+
await waitFor(async () => {
15+
const folder = await canvas.findByText('An Ordered Folder');
16+
expect(folder).toBeInTheDocument();
17+
expect(canvas.getByText('Tue Apr 16 2019 by Preview')).toBeInTheDocument();
1418

15-
expect(await canvas.findByText('An Ordered Folder')).toBeInTheDocument();
16-
expect(canvas.getByText('Tue Apr 16 2019 by Preview')).toBeInTheDocument();
19+
expect(canvas.getByText('Archive')).toBeInTheDocument();
20+
expect(canvas.getByText('Wed Dec 16 2020 by Preview')).toBeInTheDocument();
1721

18-
expect(canvas.getByText('Archive')).toBeInTheDocument();
19-
expect(canvas.getByText('Wed Dec 16 2020 by Preview')).toBeInTheDocument();
22+
expect(canvas.getByText('Archived Folder')).toBeInTheDocument();
23+
expect(canvas.getByText('Thu Dec 17 2020 by Preview')).toBeInTheDocument();
2024

21-
expect(canvas.getByText('Archived Folder')).toBeInTheDocument();
22-
expect(canvas.getByText('Thu Dec 17 2020 by Preview')).toBeInTheDocument();
23-
24-
expect(canvas.getByText('Book Sample.pdf')).toBeInTheDocument();
25-
expect(canvas.getByText('Thu Dec 8 2022 by Preview')).toBeInTheDocument();
25+
expect(canvas.getByText('Book Sample.pdf')).toBeInTheDocument();
26+
expect(canvas.getByText('Thu Dec 8 2022 by Preview')).toBeInTheDocument();
27+
});
2628
},
2729
};
2830

@@ -45,7 +47,7 @@ export const openDeleteConfirmationDialog = {
4547
await userEvent.click(moreOptionsButton);
4648

4749
const dropdown = await screen.findByRole('menu');
48-
const deleteButton = within(dropdown).findByText('Delete');
50+
const deleteButton = within(dropdown).getByText('Delete');
4951
expect(deleteButton).toBeInTheDocument();
5052
await userEvent.click(deleteButton);
5153

@@ -156,6 +158,16 @@ export const closeShareDialog = {
156158
},
157159
};
158160

161+
export const withMoreOptionsAndShareButton = {
162+
play: async ({ canvasElement }) => {
163+
const canvas = within(canvasElement);
164+
await waitFor(async () => {
165+
const row = canvas.getByText('Thu Dec 8 2022 by Preview');
166+
await userEvent.click(row);
167+
});
168+
},
169+
};
170+
159171
export default {
160172
title: 'Elements/ContentExplorer/tests/ContentExplorer/visual',
161173
component: ContentExplorer,

0 commit comments

Comments
 (0)