test(frontend): await legacy route headings
Wait for the redirected route content before asserting rendered headings. Refs #10 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -39,7 +39,7 @@ describe('Ticket #8 — anciennes routes et navigation', () => {
|
|||||||
})
|
})
|
||||||
expect(router.state.historyAction).toBe('REPLACE')
|
expect(router.state.historyAction).toBe('REPLACE')
|
||||||
expect(router.state.location.state).toMatchObject({ notice: expect.any(String) })
|
expect(router.state.location.state).toMatchObject({ notice: expect.any(String) })
|
||||||
expect(screen.getByRole('heading', { name: 'Synthèses conservées' })).toBeInTheDocument()
|
expect(await screen.findByRole('heading', { name: 'Synthèses conservées' })).toBeInTheDocument()
|
||||||
expect(screen.queryByRole('heading', { name: 'Ancien fil d’actualités' })).not.toBeInTheDocument()
|
expect(screen.queryByRole('heading', { name: 'Ancien fil d’actualités' })).not.toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ describe('Ticket #8 — anciennes routes et navigation', () => {
|
|||||||
if (router.state.location.pathname !== '/admin/sources') throw new Error(`route remained ${router.state.location.pathname}`)
|
if (router.state.location.pathname !== '/admin/sources') throw new Error(`route remained ${router.state.location.pathname}`)
|
||||||
})
|
})
|
||||||
expect(router.state.historyAction).toBe('REPLACE')
|
expect(router.state.historyAction).toBe('REPLACE')
|
||||||
expect(screen.getByRole('heading', { name: 'Sources et plafonds' })).toBeInTheDocument()
|
expect(await screen.findByRole('heading', { name: 'Sources et plafonds' })).toBeInTheDocument()
|
||||||
expect(screen.queryByRole('heading', { name: 'Ancien historique des jobs' })).not.toBeInTheDocument()
|
expect(screen.queryByRole('heading', { name: 'Ancien historique des jobs' })).not.toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user