Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix act errors in SaveDatasetActionButton test #21362

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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