File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ module.exports = {
42
42
'max-nested-callbacks' : 0 ,
43
43
'promise/prefer-await-to-then' : 0 ,
44
44
'promise/always-return' : 0 ,
45
- 'promise/catch-or-return' : 0
45
+ 'promise/catch-or-return' : 0 ,
46
46
} ,
47
- }
47
+ } ,
48
48
] ,
49
49
}
Original file line number Diff line number Diff line change @@ -11,6 +11,28 @@ describe('Localization', () => {
11
11
it ( 'should use the NEXT_LOCALE cookie to determine the default locale' , ( ) => {
12
12
cy . setCookie ( 'NEXT_LOCALE' , 'fr' )
13
13
cy . visit ( '/' ) ;
14
+
15
+ cy . findByText ( 'The current locale is fr' )
16
+ } )
17
+
18
+ it ( 'should use the NEXT_LOCALE cookie over Accept-Language header to determine the default locale' , ( ) => {
19
+ // cy.setCookie('NEXT_LOCALE', 'en')
20
+ cy . visit ( {
21
+ url : '/' ,
22
+ headers : {
23
+ 'Accept-Language' : 'fr;q=0.9'
24
+ }
25
+ } ) ;
14
26
cy . findByText ( 'The current locale is fr' )
27
+
28
+ cy . setCookie ( 'NEXT_LOCALE' , 'en' )
29
+ cy . visit ( {
30
+ url : '/' ,
31
+ headers : {
32
+ 'Accept-Language' : 'fr;q=0.9'
33
+ }
34
+ } ) ;
35
+
36
+ cy . findByText ( 'The current locale is en' )
15
37
} )
16
38
} )
You can’t perform that action at this time.
0 commit comments