diff options
Diffstat (limited to 'tests/cypress/e2e/back-to-top.cy.ts')
| -rw-r--r-- | tests/cypress/e2e/back-to-top.cy.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/cypress/e2e/back-to-top.cy.ts b/tests/cypress/e2e/back-to-top.cy.ts new file mode 100644 index 0000000..06ac3e6 --- /dev/null +++ b/tests/cypress/e2e/back-to-top.cy.ts @@ -0,0 +1,14 @@ +describe('Back to top', () => { + it('show a back to top button when scrolling', async () => { + cy.visit('/'); + cy.findByRole('link', { name: /Retour en haut de page/i }).should( + 'not.be.visible' + ); + + // See @components/templates/layout/layout.tsx for scroll position. + cy.scrollTo(0, 300); + cy.findByRole('link', { name: /Retour en haut de page/i }).should( + 'be.visible' + ); + }); +}); |
