aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-27 18:26:28 +0200
committerArmand Philippot <git@armandphilippot.com>2022-06-02 19:10:28 +0200
commitf349437f7ed3d110ec609ab0bf5c622b6a4dfdb8 (patch)
tree4c5282f892c39ec7efc9e31a088375b0b073e61f
parentefb03c205a0d4448f4625381676606a8853ce1e6 (diff)
test(e2e): add back to top button visibility test
-rw-r--r--tests/cypress/e2e/back-to-top.cy.ts14
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'
+ );
+ });
+});