@@ -12,14 +12,22 @@ describe('Localization', () => {
12
12
cy . setCookie ( 'NEXT_LOCALE' , 'fr' )
13
13
cy . visit ( '/' )
14
14
15
+ cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /fr/` )
15
16
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
+
16
23
cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /fr/` )
24
+ cy . findByText ( 'The current locale is fr' )
17
25
} )
18
26
19
27
it ( 'should use Accept-Language to choose a locale' , ( ) => {
20
28
cy . visit ( '/' , {
21
29
headers : {
22
- 'Accept-Language' : 'fr;q=0.9 ' ,
30
+ 'Accept-Language' : 'fr-FR,fr ;q=0.5 ' ,
23
31
} ,
24
32
} )
25
33
cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /fr/` )
@@ -31,11 +39,10 @@ describe('Localization', () => {
31
39
cy . visit ( {
32
40
url : '/' ,
33
41
headers : {
34
- 'Accept-Language' : 'fr;q=0.9 ' ,
42
+ 'Accept-Language' : 'fr-FR,fr ;q=0.5 ' ,
35
43
} ,
36
44
} )
37
45
cy . url ( ) . should ( 'eq' , `${ Cypress . config ( ) . baseUrl } /` )
38
-
39
46
cy . findByText ( 'The current locale is en' )
40
47
} )
41
48
} )
0 commit comments