diff --git a/apps/app/e2e/shell/clients.spec.ts b/apps/app/e2e/shell/clients.spec.ts index 4096862d..f89feb25 100644 --- a/apps/app/e2e/shell/clients.spec.ts +++ b/apps/app/e2e/shell/clients.spec.ts @@ -369,7 +369,7 @@ for (const [locale, dict] of LANGUAGES) { level: 1, name: dict['clients.not_found.title'], }), - ).toBeVisible() + ).toBeFocused() await expect(page.getByText(secret)).toHaveCount(0) } await expectAccessible(page, 'the client not found screen') diff --git a/apps/app/src/components/clients/ClientNotFound.tsx b/apps/app/src/components/clients/ClientNotFound.tsx index d8138274..02a015ac 100644 --- a/apps/app/src/components/clients/ClientNotFound.tsx +++ b/apps/app/src/components/clients/ClientNotFound.tsx @@ -1,18 +1,18 @@ import ButtonLink from '@/components/ui/ButtonLink' import Card from '@/components/ui/Card' +import { usePageHeading } from '@/app/usePageHeading' import { useT } from '@/i18n/useT' /** The same screen for an unknown id and an id of another workspace (contract §11.1). */ export default function ClientNotFound() { const t = useT() + const heading = usePageHeading() return ( -

+

{t('clients.not_found.title')}

-

- {t('clients.not_found.body')} -

+

{t('clients.not_found.body')}

{t('clients.not_found.back')} diff --git a/apps/app/tests/unit/routes.clients.test.tsx b/apps/app/tests/unit/routes.clients.test.tsx index cadc10ea..9e4c6d42 100644 --- a/apps/app/tests/unit/routes.clients.test.tsx +++ b/apps/app/tests/unit/routes.clients.test.tsx @@ -294,7 +294,7 @@ describe('client edit', () => { describe('client page', () => { it('shows the same « introuvable » for an unknown id and a malformed one', async () => { mount(`/app/clients/${ID}`) - expect(await screen.findByRole('heading', { name: fr['clients.not_found.title'] })).toBeInTheDocument() + expect(await screen.findByRole('heading', { name: fr['clients.not_found.title'] })).toHaveFocus() cleanup() mount('/app/clients/not-an-id') expect(await screen.findByRole('heading', { name: fr['clients.not_found.title'] })).toBeInTheDocument()