@@ -135,7 +135,7 @@ describe('utils', () => {
135
135
} ) ;
136
136
137
137
describe ( 'checkIfGDPRApplies' , ( ) => {
138
- const returnValues = [ [ 'en-GB' ] , [ 'fr-BE' ] , 'lt' , 'en-US' ] ;
138
+ const returnValues = [ [ 'en-GB' ] , [ 'de' ] , [ ' fr-BE'] , 'lt' , 'en-US' ] ;
139
139
140
140
beforeEach ( ( ) => {
141
141
window . fetch = jest . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( { headers : new Map ( [ ] ) } ) ) ;
@@ -161,6 +161,16 @@ describe('utils', () => {
161
161
} ) ;
162
162
} ) ;
163
163
164
+ it ( 'skips the language check if the config is set to use only geoIP' , ( done ) => {
165
+ config . useGeolocationOnly = true ;
166
+ checkIfGDPRApplies ( 'url' , ( res ) => {
167
+ expect ( res ) . eq ( false ) ;
168
+ expect ( window . fetch . mock . calls . length ) . to . equal ( 1 ) ;
169
+ config . useGeolocationOnly = false ;
170
+ done ( ) ;
171
+ } ) ;
172
+ } ) ;
173
+
164
174
it ( 'handles Internet Explorer navigator implementation' , ( done ) => {
165
175
checkIfGDPRApplies ( 'url' , ( res ) => {
166
176
expect ( res . applies ) . eq ( true ) ;
@@ -171,7 +181,7 @@ describe('utils', () => {
171
181
} ) ;
172
182
} ) ;
173
183
174
- it ( 'fallbacks to ip resolution' , ( done ) => {
184
+ it ( 'falls back to IP resolution' , ( done ) => {
175
185
checkIfGDPRApplies ( 'url' , ( res ) => {
176
186
177
187
expect ( res ) . eq ( false ) ;
0 commit comments