diff options
Diffstat (limited to 'tests/cypress/e2e/nav.cy.ts')
| -rw-r--r-- | tests/cypress/e2e/nav.cy.ts | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/cypress/e2e/nav.cy.ts b/tests/cypress/e2e/nav.cy.ts index 5851058..14d4e8c 100644 --- a/tests/cypress/e2e/nav.cy.ts +++ b/tests/cypress/e2e/nav.cy.ts @@ -1,3 +1,5 @@ +import { ROUTES } from '../../../src/utils/constants'; + describe( 'Main navigation', { viewportWidth: 1280, viewportHeight: 720 }, @@ -35,27 +37,27 @@ describe( cy.findByLabelText(/Ouvrir le menu/i).should('be.hidden'); }); - it('should navigate to the blog page', async () => { + it('should navigate to the blog page', () => { cy.findByRole('link', { name: /Blog/i }).click(); - cy.url().should('include', '/blog'); + cy.url().should('include', ROUTES.BLOG); cy.findByRole('heading', { level: 1 }).contains('Blog'); }); - it('should navigate to the CV page', async () => { + it('should navigate to the CV page', () => { cy.findByRole('link', { name: /CV/i }).click(); - cy.url().should('include', '/cv'); + cy.url().should('include', ROUTES.CV); cy.findByRole('heading', { level: 1 }).contains('CV'); }); - it('should navigate to the projects page', async () => { - cy.findByRole('link', { name: /Projects/i }).click(); - cy.url().should('include', '/projets'); + it('should navigate to the projects page', () => { + cy.findByRole('link', { name: /Projets/i }).click(); + cy.url().should('include', ROUTES.PROJECTS); cy.findByRole('heading', { level: 1 }).contains('Projets'); }); - it('should navigate to the contact page', async () => { + it('should navigate to the contact page', () => { cy.findByRole('link', { name: /Contact/i }).click(); - cy.url().should('include', '/contact'); + cy.url().should('include', ROUTES.CONTACT); cy.findByRole('heading', { level: 1 }).contains('Contact'); }); } @@ -66,9 +68,9 @@ describe('Footer navigation', () => { cy.visit('/'); }); - it('should navigate to the legal notice page', async () => { + it('should navigate to the legal notice page', () => { cy.findByRole('link', { name: /Mentions légales/i }).click(); - cy.url().should('include', '/mentions-legales'); + cy.url().should('include', ROUTES.LEGAL_NOTICE); cy.findByRole('heading', { level: 1 }).contains('Mentions légales'); }); }); |
