Skip to content

Commit

Permalink
chore(chromatic): fix snapshots (#3774)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-in-a-box authored Dec 10, 2024
1 parent d09b8cb commit c55cce9
Showing 1 changed file with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ import { DEFAULT_HOSTNAME_API } from '../../../../constants';
export const basic = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await waitFor(async () => {
const folder = await canvas.findByText('An Ordered Folder');
expect(folder).toBeInTheDocument();
expect(canvas.getByText('Tue Apr 16 2019 by Preview')).toBeInTheDocument();

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

expect(canvas.getByText('Archive')).toBeInTheDocument();
expect(canvas.getByText('Wed Dec 16 2020 by Preview')).toBeInTheDocument();
expect(canvas.getByText('Archived Folder')).toBeInTheDocument();
expect(canvas.getByText('Thu Dec 17 2020 by Preview')).toBeInTheDocument();

expect(canvas.getByText('Archived Folder')).toBeInTheDocument();
expect(canvas.getByText('Thu Dec 17 2020 by Preview')).toBeInTheDocument();

expect(canvas.getByText('Book Sample.pdf')).toBeInTheDocument();
expect(canvas.getByText('Thu Dec 8 2022 by Preview')).toBeInTheDocument();
expect(canvas.getByText('Book Sample.pdf')).toBeInTheDocument();
expect(canvas.getByText('Thu Dec 8 2022 by Preview')).toBeInTheDocument();
});
},
};

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

const dropdown = await screen.findByRole('menu');
const deleteButton = within(dropdown).findByText('Delete');
const deleteButton = within(dropdown).getByText('Delete');
expect(deleteButton).toBeInTheDocument();
await userEvent.click(deleteButton);

Expand Down Expand Up @@ -156,6 +158,16 @@ export const closeShareDialog = {
},
};

export const withMoreOptionsAndShareButton = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await waitFor(async () => {
const row = canvas.getByText('Thu Dec 8 2022 by Preview');
await userEvent.click(row);
});
},
};

export default {
title: 'Elements/ContentExplorer/tests/ContentExplorer/visual',
component: ContentExplorer,
Expand Down

0 comments on commit c55cce9

Please sign in to comment.