Skip to content

Commit 7e26769

Browse files
committed
chore: fix tests
1 parent c95b33b commit 7e26769

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cypress/integration/static-root/i18n.spec.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@ describe('Localization', () => {
1212
cy.setCookie('NEXT_LOCALE', 'fr')
1313
cy.visit('/')
1414

15+
cy.url().should('eq', `${Cypress.config().baseUrl}/fr/`)
1516
cy.findByText('The current locale is fr')
17+
})
18+
19+
it('should use the nf_lang cookie to determine the default locale', () => {
20+
cy.setCookie('nf_lang', 'fr')
21+
cy.visit('/')
22+
1623
cy.url().should('eq', `${Cypress.config().baseUrl}/fr/`)
24+
cy.findByText('The current locale is fr')
1725
})
1826

1927
it('should use Accept-Language to choose a locale', () => {
2028
cy.visit('/', {
2129
headers: {
22-
'Accept-Language': 'fr;q=0.9',
30+
'Accept-Language': 'fr-FR,fr;q=0.5',
2331
},
2432
})
2533
cy.url().should('eq', `${Cypress.config().baseUrl}/fr/`)
@@ -31,11 +39,10 @@ describe('Localization', () => {
3139
cy.visit({
3240
url: '/',
3341
headers: {
34-
'Accept-Language': 'fr;q=0.9',
42+
'Accept-Language': 'fr-FR,fr;q=0.5',
3543
},
3644
})
3745
cy.url().should('eq', `${Cypress.config().baseUrl}/`)
38-
3946
cy.findByText('The current locale is en')
4047
})
4148
})

0 commit comments

Comments
 (0)