test(admin): wait for the modal cleanup after deleting a list
This commit is contained in:
parent
f9e5b142c2
commit
1a7d16f8a9
1 changed files with 3 additions and 2 deletions
|
|
@ -145,8 +145,9 @@ describe('deleting a list', () => {
|
|||
await user.click(within(dialog).getByRole('button', { name: /^delete$/i }))
|
||||
expect(await screen.findByRole('heading', { name: /^lists$/i })).toBeInTheDocument()
|
||||
expect(state.lists.map((l) => l.id)).toEqual([2])
|
||||
expect(screen.queryByRole('link', { name: 'dev@example.org' })).not.toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'news@example.org' })).toBeInTheDocument()
|
||||
// The overview refetches and the modal's aria-hidden is cleaned up asynchronously: wait for both.
|
||||
expect(await screen.findByRole('link', { name: 'news@example.org' })).toBeInTheDocument()
|
||||
await waitFor(() => expect(screen.queryByRole('link', { name: 'dev@example.org' })).not.toBeInTheDocument())
|
||||
})
|
||||
|
||||
it('shows a server error and stays on the page', async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue