Skip to content

Commit

Permalink
fix(metadata-sidebar): Fix storybook tests (#3695)
Browse files Browse the repository at this point in the history
* fix(metadata-sidebar): Fix failing test

* fix(content-explorer): fix failing RenameDialog test
  • Loading branch information
JakubKida authored Oct 3, 2024
1 parent 002d496 commit 8326472
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const openRenameDialog = {
expect(renameButton).toBeInTheDocument();
await userEvent.click(renameButton);

expect(await screen.findByText('Please enter a new name for Book Sample:')).toBeInTheDocument();
expect(await screen.findByText('Rename File')).toBeInTheDocument();
},
};

Expand All @@ -97,12 +97,12 @@ export const closeRenameDialog = {
expect(renameButton).toBeInTheDocument();
await userEvent.click(renameButton);

expect(await screen.findByText('Please enter a new name for Book Sample:')).toBeInTheDocument();
expect(await screen.findByText('Rename File')).toBeInTheDocument();
const cancelButton = screen.getByText('Cancel');
await userEvent.click(cancelButton);

await waitFor(() => {
expect(screen.queryByText('Please enter a new name for Book Sample:')).not.toBeInTheDocument();
expect(screen.queryByText('Rename File')).not.toBeInTheDocument();
});
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const MetadataInstanceEditorCancelChanges: StoryObj<typeof MetadataSideba

headlines = await canvas.findAllByRole('heading', { level: 1 });
expect(headlines).toHaveLength(1);
expect(headlines.map(heading => heading.textContent)).toEqual(expect.arrayContaining(['My Template']));
expect(headlines.map(heading => heading.textContent)).toEqual(expect.arrayContaining(['Custom Metadata']));

// cancel editing - back to list view
const cancelButton = await canvas.findByRole('button', { name: 'Cancel' });
Expand Down

0 comments on commit 8326472

Please sign in to comment.