diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-12-08 19:19:37 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-12-09 18:04:09 +0100 |
| commit | 2cc983064467fdef5630eeabc1a87d454afdb58d (patch) | |
| tree | 92df51a32a35bd791c161b2322c0512dc495d994 /tests/cypress | |
| parent | d375e5c9f162cbd84a6e6462977db56519d09f75 (diff) | |
refactor(pages): refine 404 page
* refresh topics and thematics list using hooks
* add Cypress tests
Diffstat (limited to 'tests/cypress')
| -rw-r--r-- | tests/cypress/e2e/pages/404.cy.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/cypress/e2e/pages/404.cy.ts b/tests/cypress/e2e/pages/404.cy.ts new file mode 100644 index 0000000..7899275 --- /dev/null +++ b/tests/cypress/e2e/pages/404.cy.ts @@ -0,0 +1,31 @@ +import { ROUTES } from '../../../../src/utils/constants'; + +describe('404 Page', () => { + beforeEach(() => { + cy.visit(ROUTES.NOT_FOUND, { failOnStatusCode: false }); + }); + + it('successfully loads', () => { + cy.findByRole('heading', { level: 1 }).should( + 'contain.text', + 'Page non trouvée' + ); + }); + + it('contains a breadcrumbs', () => { + cy.findByRole('navigation', { name: 'Fil d’Ariane' }).should('exist'); + }); + + it('contains a thematics list widget and a topics list widget', () => { + cy.findByRole('heading', { level: 2, name: 'Thématiques' }).should('exist'); + cy.findByRole('heading', { level: 2, name: 'Sujets' }).should('exist'); + }); + + it('provides a form to search for keywords', () => { + const keywords = 'coldark'; + + cy.findByRole('searchbox').type(keywords); + cy.findByRole('button', { name: /Rechercher/ }).click(); + cy.findByRole('heading', { level: 1 }).should('contain.text', keywords); + }); +}); |
