Skip to content

Commit

Permalink
2 act errors removed from SaveDatasetActionButton test
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndsiWilliams committed Sep 7, 2022
1 parent ce3d38d commit de8eb9e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const overlayMenu = (
);

describe('SaveDatasetActionButton', () => {
it('renders a split save button', () => {
test('renders a split save button', async () => {
render(
<SaveDatasetActionButton
setShowSave={() => true}
Expand All @@ -40,11 +40,14 @@ describe('SaveDatasetActionButton', () => {
const saveBtn = screen.getByRole('button', { name: /save/i });
const caretBtn = screen.getByRole('button', { name: /caret-down/i });

expect(
await screen.findByRole('button', { name: /save/i }),
).toBeInTheDocument();
expect(saveBtn).toBeVisible();
expect(caretBtn).toBeVisible();
});

it('renders a "save dataset" dropdown menu item when user clicks caret button', () => {
test('renders a "save dataset" dropdown menu item when user clicks caret button', async () => {
render(
<SaveDatasetActionButton
setShowSave={() => true}
Expand All @@ -53,6 +56,9 @@ describe('SaveDatasetActionButton', () => {
);

const caretBtn = screen.getByRole('button', { name: /caret-down/i });
expect(
await screen.findByRole('button', { name: /caret-down/i }),
).toBeInTheDocument();
userEvent.click(caretBtn);

const saveDatasetMenuItem = screen.getByText(/save dataset/i);
Expand Down

0 comments on commit de8eb9e

Please sign in to comment.