aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cypress/e2e/settings.cy.ts
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-15 19:11:06 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-15 19:11:06 +0100
commitbb2d78e75626a99ce8ccd5be31924bd4dd799faf (patch)
tree8f2f24a924d27a7d9b8cf8a81784a3bd157b02b5 /tests/cypress/e2e/settings.cy.ts
parent26a1e3a7a08e4b0fdb4dfcc3ed6a6cc21bcef104 (diff)
test: fix most of the e2e tests errors
* back-to-top test is not working: for some reasons, the link only appears when manually scrolling * search test has failure test: it seems the page meta is too long to load Anyway, the pages will be refactored and the e2e should also be refactored. But the back to top test remains problematic...
Diffstat (limited to 'tests/cypress/e2e/settings.cy.ts')
-rw-r--r--tests/cypress/e2e/settings.cy.ts18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/cypress/e2e/settings.cy.ts b/tests/cypress/e2e/settings.cy.ts
index abdbcdf..f58055b 100644
--- a/tests/cypress/e2e/settings.cy.ts
+++ b/tests/cypress/e2e/settings.cy.ts
@@ -4,12 +4,18 @@ describe('Settings', () => {
});
it('should open and close a settings menu by clicking on a button', () => {
- cy.findByLabelText(/Fermer les réglages/i).should('not.exist');
+ // findByLabelText does not return the input but the label...
+ cy.findByLabelText(/Ouvrir les réglages/i)
+ .prev()
+ .should('not.be.checked');
+ cy.findByLabelText(/Ouvrir les réglages/i).click();
+ cy.findByLabelText(/Ouvrir les réglages/i)
+ .prev()
+ .should('be.checked');
cy.findByLabelText(/Ouvrir les réglages/i).click();
- cy.findByLabelText(/Ouvrir les réglages/i).should('not.exist');
- cy.findByLabelText(/Fermer les réglages/i).click();
- cy.findByLabelText(/Fermer les réglages/i).should('not.exist');
- cy.findByLabelText(/Ouvrir les réglages/i).should('exist');
+ cy.findByLabelText(/Ouvrir les réglages/i)
+ .prev()
+ .should('not.be.checked');
});
it('should open and close a tooltip by clicking on a button', () => {
@@ -44,7 +50,7 @@ describe('Settings', () => {
.parent()
.should('have.attr', 'data-theme', 'dark')
.then(() => {
- expect(localStorage.getItem('theme')).to.eq('dark');
+ expect(localStorage.getItem('theme')).to.eq('"dark"');
});
} else {
cy.findByRole('radiogroup', { name: /Thème/i })