mirror of
https://github.com/gotson/komga.git
synced 2026-10-14 22:37:52 +00:00
fix flaky ui test
This commit is contained in:
parent
9ae3c8def7
commit
aab40c2d04
1 changed files with 11 additions and 1 deletions
|
|
@ -45,7 +45,17 @@ export const MatchingPasswords: Story = {
|
|||
await userEvent.click(password2)
|
||||
await userEvent.type(password2, 'abc')
|
||||
|
||||
await waitFor(() => expect(canvas.queryByText(/must be identical/i)).not.toBeInTheDocument())
|
||||
await waitFor(() => {
|
||||
const errorMessage = canvas.queryByText(/must be identical/i)
|
||||
|
||||
if (errorMessage) {
|
||||
// If the UI library kept it in the DOM, assert that it is hidden via CSS
|
||||
void expect(errorMessage).not.toBeVisible()
|
||||
} else {
|
||||
// If it was completely removed from the DOM, assert it is null
|
||||
void expect(errorMessage).toBeNull()
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue