File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
cypress/integration/static-root Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -13,24 +13,28 @@ describe('Localization', () => {
13
13
cy . visit ( '/' )
14
14
15
15
cy . findByText ( 'The current locale is fr' )
16
+ cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /fr/` )
16
17
} )
17
18
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 ( '/' , {
21
21
headers : {
22
22
'Accept-Language' : 'fr;q=0.9' ,
23
23
} ,
24
24
} )
25
25
cy . findByText ( 'The current locale is fr' )
26
+ cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /fr/` )
27
+ } )
26
28
29
+ it ( 'should use the NEXT_LOCALE cookie over Accept-Language header to determine the default locale' , ( ) => {
27
30
cy . setCookie ( 'NEXT_LOCALE' , 'en' )
28
31
cy . visit ( {
29
32
url : '/' ,
30
33
headers : {
31
34
'Accept-Language' : 'fr;q=0.9' ,
32
35
} ,
33
36
} )
37
+ cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /` )
34
38
35
39
cy . findByText ( 'The current locale is en' )
36
40
} )
Original file line number Diff line number Diff line change 1
1
describe ( 'Rewrites and Redirects' , ( ) => {
2
2
it ( 'rewrites: points /old to /' , ( ) => {
3
3
// preview mode is off by default
4
- cy . visit ( '/old/another' )
4
+ cy . visit ( '/old/another/ ' )
5
5
cy . findByText ( 'Another page' )
6
- cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /old/another` )
6
+ cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /old/another/ ` )
7
7
} )
8
8
9
9
it ( 'redirects: redirects /redirectme to /' , ( ) => {
You can’t perform that action at this time.
0 commit comments