diff --git a/circle.yml b/circle.yml index 0e82c9e23..58e7e434d 100644 --- a/circle.yml +++ b/circle.yml @@ -43,6 +43,8 @@ jobs: environment: ## this enables colors in the output TERM: xterm + EN_SITE: '${path}' + FR_SITE: '${path}' CYPRESS_baseUrl: http://localhost:5000 steps: diff --git a/cypress/.eslintrc.yaml b/cypress/.eslintrc.yaml index 9883a4f08..e079cdeab 100644 --- a/cypress/.eslintrc.yaml +++ b/cypress/.eslintrc.yaml @@ -1,5 +1,4 @@ globals: cy: false Cypress: false -ecmaFeatures: - requireConfigFile: false +parser: esprima diff --git a/cypress/integration/mon-entreprise/navigation.js b/cypress/integration/mon-entreprise/navigation.js new file mode 100644 index 000000000..326ea36f2 --- /dev/null +++ b/cypress/integration/mon-entreprise/navigation.js @@ -0,0 +1,17 @@ +describe('Navigation', function() { + const fr = Cypress.env('language') === 'fr' + it('should enable switching site language', () => { + cy.visit( + fr + ? '/entreprise/devenir-auto-entrepreneur' + : '/company/become-auto-entrepreneur' + ) + cy.contains(fr ? 'Switch to English' : 'Passer en français').click() + cy.url().should( + 'include', + fr + ? '/company/become-auto-entrepreneur' + : '/entreprise/devenir-auto-entrepreneur' + ) + }) +}) diff --git a/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js b/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js index c366ce922..17c8007d7 100644 --- a/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js +++ b/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js @@ -72,7 +72,7 @@ const Footer = ({ colours: { colour } }) => { {hrefLang === 'fr' ? ( <> Passer en français {emoji('🇫🇷')} ) : hrefLang === 'en' ? ( - <> Switch to english {emoji('🇬🇧')} + <> Switch to English {emoji('🇬🇧')} ) : ( hrefLang )}