@@ -135,7 +135,7 @@ describe('utils', () => {
135135 } ) ;
136136
137137 describe ( 'checkIfGDPRApplies' , ( ) => {
138- const returnValues = [ [ 'en-GB' ] , [ 'fr-BE' ] , 'lt' , 'en-US' ] ;
138+ const returnValues = [ [ 'en-GB' ] , [ 'de' ] , [ ' fr-BE'] , 'lt' , 'en-US' ] ;
139139
140140 beforeEach ( ( ) => {
141141 window . fetch = jest . fn ( ) . mockImplementation ( ( ) => Promise . resolve ( { headers : new Map ( [ ] ) } ) ) ;
@@ -161,6 +161,16 @@ describe('utils', () => {
161161 } ) ;
162162 } ) ;
163163
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+
164174 it ( 'handles Internet Explorer navigator implementation' , ( done ) => {
165175 checkIfGDPRApplies ( 'url' , ( res ) => {
166176 expect ( res . applies ) . eq ( true ) ;
@@ -171,7 +181,7 @@ describe('utils', () => {
171181 } ) ;
172182 } ) ;
173183
174- it ( 'fallbacks to ip resolution' , ( done ) => {
184+ it ( 'falls back to IP resolution' , ( done ) => {
175185 checkIfGDPRApplies ( 'url' , ( res ) => {
176186
177187 expect ( res ) . eq ( false ) ;
0 commit comments