test: await click instead of element not in doc
This commit is contained in:
parent
7d537bcb66
commit
69b7c574ae
1 changed files with 3 additions and 5 deletions
|
|
@ -222,16 +222,14 @@ describe('Repositories edit mode', () => {
|
|||
});
|
||||
expect(repoCheckbox).toBeChecked();
|
||||
|
||||
user.click(repoCheckbox);
|
||||
await user.click(repoCheckbox);
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
await screen.findByText(/Are you sure?/);
|
||||
const removeAnywayBtn = await screen.findByRole('button', {
|
||||
name: /Remove anyway/,
|
||||
});
|
||||
user.click(removeAnywayBtn);
|
||||
await user.click(removeAnywayBtn);
|
||||
|
||||
await waitFor(() =>
|
||||
expect(screen.queryByText(/Are you sure?/)).not.toBeInTheDocument()
|
||||
);
|
||||
expect(repoCheckbox).not.toBeChecked();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue