ajoute des tests E2E pour le changement de langue

demo-contrôles
Johan Girod 2019-02-08 14:19:33 +01:00
parent 644566c804
commit 5ab038bb39
4 changed files with 21 additions and 3 deletions

View File

@ -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:

View File

@ -1,5 +1,4 @@
globals:
cy: false
Cypress: false
ecmaFeatures:
requireConfigFile: false
parser: esprima

View File

@ -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'
)
})
})

View File

@ -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
)}