aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cypress
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-29 18:07:20 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-29 18:07:20 +0100
commitd363306235f2a48f16e488f20f73e2233ddcf281 (patch)
tree5e86a7b5f38416d7ee56a9aff5ef972aa73d82b1 /tests/cypress
parentdfa894b76ee3584bf169710c78c57330c5d6ee67 (diff)
refactor(pages): improve Homepage
* move custom homepage components that does not require props to the MDX file (links should not need to be translated here but where they are defined) * move SEO title and meta desc to MDX file * make Page component the wrapper instead of using a React fragment * fix MDX module types
Diffstat (limited to 'tests/cypress')
-rw-r--r--tests/cypress/e2e/pages/homepage.cy.ts27
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
+ );
+ });
});