Skip to content

Commit 2e0a0b8

Browse files
committed
chore: update tests
1 parent 02d2b9b commit 2e0a0b8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,28 @@ describe('Localization', () => {
1313
cy.visit('/')
1414

1515
cy.findByText('The current locale is fr')
16+
cy.url().should('eq', `${Cypress.config().baseUrl}/fr/`)
1617
})
1718

18-
it('should use the NEXT_LOCALE cookie over Accept-Language header to determine the default locale', () => {
19-
cy.visit({
20-
url: '/',
19+
it('should use Accept-Language to choose a locale', () => {
20+
cy.visit('/', {
2121
headers: {
2222
'Accept-Language': 'fr;q=0.9',
2323
},
2424
})
2525
cy.findByText('The current locale is fr')
26+
cy.url().should('eq', `${Cypress.config().baseUrl}/fr/`)
27+
})
2628

29+
it('should use the NEXT_LOCALE cookie over Accept-Language header to determine the default locale', () => {
2730
cy.setCookie('NEXT_LOCALE', 'en')
2831
cy.visit({
2932
url: '/',
3033
headers: {
3134
'Accept-Language': 'fr;q=0.9',
3235
},
3336
})
37+
cy.url().should('eq', `${Cypress.config().baseUrl}/`)
3438

3539
cy.findByText('The current locale is en')
3640
})

cypress/integration/static-root/rewrites-redirects.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
describe('Rewrites and Redirects', () => {
22
it('rewrites: points /old to /', () => {
33
// preview mode is off by default
4-
cy.visit('/old/another')
4+
cy.visit('/old/another/')
55
cy.findByText('Another page')
6-
cy.url().should('eq', `${Cypress.config().baseUrl}/old/another`)
6+
cy.url().should('eq', `${Cypress.config().baseUrl}/old/another/`)
77
})
88

99
it('redirects: redirects /redirectme to /', () => {

0 commit comments

Comments
 (0)