diff options
Diffstat (limited to 'tests/cypress')
| -rw-r--r-- | tests/cypress/e2e/pages/homepage.cy.ts | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/cypress/e2e/pages/homepage.cy.ts b/tests/cypress/e2e/pages/homepage.cy.ts index 2d95767..29318be 100644 --- a/tests/cypress/e2e/pages/homepage.cy.ts +++ b/tests/cypress/e2e/pages/homepage.cy.ts @@ -1,9 +1,34 @@ import { CONFIG } from '../../../../src/utils/config'; +import { ROUTES } from '../../../../src/utils/constants'; describe('HomePage', () => { + beforeEach(() => { + cy.visit(ROUTES.HOME); + }); + it('successfully loads', () => { - cy.visit('/'); cy.findByRole('heading', { level: 1 }).contains(CONFIG.name); cy.findByText(CONFIG.baseline).should('exist'); }); + + it('contains the three most recent articles', () => { + // eslint-disable-next-line @typescript-eslint/no-magic-numbers + cy.findAllByRole('link', { name: /^Consulter/i }).should('have.length', 3); + }); + + it('contains a link to contact me', () => { + cy.findByRole('link', { name: 'Me contacter' }).should( + 'have.attr', + 'href', + ROUTES.CONTACT + ); + }); + + it('contains a link to RSS feed', () => { + cy.findByRole('link', { name: 'S’abonner' }).should( + 'have.attr', + 'href', + ROUTES.RSS + ); + }); }); |
