diff --git a/admin/src/pages/ListPage.test.tsx b/admin/src/pages/ListPage.test.tsx index 20203dd..4449a7a 100644 --- a/admin/src/pages/ListPage.test.tsx +++ b/admin/src/pages/ListPage.test.tsx @@ -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 () => {