From 47caa7c3d8537c63d11baea2e269ba601a40f934 Mon Sep 17 00:00:00 2001 From: Emile Bex Date: Tue, 22 Aug 2023 15:31:09 +0200 Subject: [PATCH] [EN-4026] tests(navigation): added test for main page navigation --- cypress.config.js | 2 +- cypress/e2e/nav.cy.js | 40 +++++++++++++++++++ cypress/e2e/nav.js | 29 -------------- .../schemas/formAddExternalOpportunity.ts | 2 +- .../schemas/formEditExternalOpportunity.ts | 2 +- src/components/utils/Inputs/Inputs.styles.ts | 3 +- .../utils/Inputs/Selects/Selects.styles.ts | 4 +- 7 files changed, 47 insertions(+), 35 deletions(-) create mode 100644 cypress/e2e/nav.cy.js delete mode 100644 cypress/e2e/nav.js diff --git a/cypress.config.js b/cypress.config.js index a5319c843..cb04e39b4 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -16,5 +16,5 @@ module.exports = defineConfig({ // implement node event listeners here }, }, - retries: 5, + retries: 3, }); diff --git a/cypress/e2e/nav.cy.js b/cypress/e2e/nav.cy.js new file mode 100644 index 000000000..eb4c1671e --- /dev/null +++ b/cypress/e2e/nav.cy.js @@ -0,0 +1,40 @@ +/* eslint-disable no-undef */ +// unstable test, need to identify the issue + +describe('Navigation', () => { + it('opens', () => { + cy.visit('/'); + cy.wait(1000); + + // cy.visit(Cypress.env('base_url')) + cy.get('header').within(() => { + cy.get('a').contains('Je cherche un emploi').click({ force: true }); + cy.wait(1000); + cy.url().should('include', 'travailler'); + }); + + cy.get('header').within(() => { + cy.get('a').contains('Je recrute').click({ force: true }); + cy.wait(1000); + cy.url().should('include', 'entreprises'); + }); + + cy.get('header').within(() => { + cy.get('a').contains('Je veux aider').click({ force: true }); + cy.wait(1000); + cy.url().should('include', 'aider'); + }); + + cy.get('header').within(() => { + cy.get('a').contains("J'oriente un candidat").click({ force: true }); + cy.wait(1000); + cy.url().should('include', 'orienter'); + }); + + cy.get('header').within(() => { + cy.get('button').contains('Découvrir les CV').click({ force: true }); + cy.wait(1000); + cy.url().should('include', 'candidats'); + }); + }); +}); diff --git a/cypress/e2e/nav.js b/cypress/e2e/nav.js deleted file mode 100644 index 466003aa7..000000000 --- a/cypress/e2e/nav.js +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable no-undef */ -// unstable test, need to identify the issue - -describe('Navigation', () => { - it('opens', () => { - cy.visit('/'); - // cy.visit(Cypress.env('base_url')) - - cy.contains('Je cherche un emploi').click(); - cy.wait(1000); - cy.url().should('include', 'travailler'); - - cy.contains('Je recrute').click(); - cy.wait(1000); - cy.url().should('include', 'entreprises'); - - cy.contains('Je veux aider').click(); - cy.wait(1000); - cy.url().should('include', 'aider'); - - cy.contains("J'oriente un candidat").click(); - cy.wait(1000); - cy.url().should('include', 'orienter'); - - cy.contains('Découvrir les CV').click(); - cy.wait(1000); - cy.url().should('include', 'candidats'); - }); -}); diff --git a/src/components/forms/schemas/formAddExternalOpportunity.ts b/src/components/forms/schemas/formAddExternalOpportunity.ts index 41a366a96..4cd41ab3f 100644 --- a/src/components/forms/schemas/formAddExternalOpportunity.ts +++ b/src/components/forms/schemas/formAddExternalOpportunity.ts @@ -118,7 +118,7 @@ export const formAddExternalOpportunityCandidate: FormSchema<{ name: 'description', component: 'textarea', title: - 'Ecrire ou copier le detail de l’offre pour faciliter le suivi de votre candidature', + 'Ecrire ou copier le detail de l’offre pour faciliter le suivi de votre candidature*', isRequired: true, }, { diff --git a/src/components/forms/schemas/formEditExternalOpportunity.ts b/src/components/forms/schemas/formEditExternalOpportunity.ts index 4d069326b..c573e1065 100644 --- a/src/components/forms/schemas/formEditExternalOpportunity.ts +++ b/src/components/forms/schemas/formEditExternalOpportunity.ts @@ -188,7 +188,7 @@ export const formEditExternalOpportunityAsAdmin: FormSchema<{ name: 'description', component: 'textarea', title: - 'Ecrire ou copier le detail de l’offre pour faciliter le suivi de votre candidature', + 'Ecrire ou copier le detail de l’offre pour faciliter le suivi de votre candidature*', isRequired: true, }, { diff --git a/src/components/utils/Inputs/Inputs.styles.ts b/src/components/utils/Inputs/Inputs.styles.ts index ef9511fb7..4450129fd 100644 --- a/src/components/utils/Inputs/Inputs.styles.ts +++ b/src/components/utils/Inputs/Inputs.styles.ts @@ -20,7 +20,7 @@ export const commonMenuOptionStyles = css` export const commonInputContainerStyles = css` font-family: Poppins, sans-serif !important; max-width: 100%; - background-color: ${COLORS.white}; + background-color: transparent; display: flex; flex-direction: column; position: relative; @@ -73,6 +73,7 @@ export const StyledLimit = styled.div` text-align: right; align-self: flex-end; min-height: 30px; + display: flex; > * { padding-top: 5px; } diff --git a/src/components/utils/Inputs/Selects/Selects.styles.ts b/src/components/utils/Inputs/Selects/Selects.styles.ts index 5cc8409fa..0a6d6f0a5 100644 --- a/src/components/utils/Inputs/Selects/Selects.styles.ts +++ b/src/components/utils/Inputs/Selects/Selects.styles.ts @@ -18,7 +18,7 @@ export const StyledSelect = styled.div` } & .Select__control--is-focused { - background-color: ${COLORS.white} !important; + background-color: transparent !important; box-shadow: none !important; border: none !important; border-radius: 0 !important; @@ -72,7 +72,7 @@ export const StyledSelect = styled.div` } & .Select__control { - background-color: ${COLORS.white}; + background-color: transparent; min-height: 30px; border: none; border-bottom: solid 2px ${COLORS.gray} !important;