@@ -25,18 +25,24 @@ let bidWithParams = function(data) {
25
25
26
26
describe ( 'AdheseAdapter' , function ( ) {
27
27
describe ( 'getUserSyncs' , function ( ) {
28
- const serverResponse = {
28
+ const serverResponses = [ {
29
29
account : 'demo'
30
- } ;
30
+ } ] ;
31
31
const gdprConsent = {
32
32
gdprApplies : true ,
33
33
consentString : 'CONSENT_STRING'
34
34
} ;
35
35
it ( 'should return empty when iframe disallowed' , function ( ) {
36
- expect ( spec . getUserSyncs ( { iframeEnabled : false } , serverResponse , gdprConsent ) ) . to . be . empty ;
36
+ expect ( spec . getUserSyncs ( { iframeEnabled : false } , serverResponses , gdprConsent ) ) . to . be . empty ;
37
+ } ) ;
38
+ it ( 'should return empty when no serverResponses present' , function ( ) {
39
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , [ ] , gdprConsent ) ) . to . be . empty ;
40
+ } ) ;
41
+ it ( 'should return empty when no account info present in the response' , function ( ) {
42
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , [ { } ] , gdprConsent ) ) . to . be . empty ;
37
43
} ) ;
38
44
it ( 'should return usersync url when iframe allowed' , function ( ) {
39
- expect ( spec . getUserSyncs ( { iframeEnabled : true } , serverResponse , gdprConsent ) ) . to . deep . equal ( [ { type : 'iframe' , url : 'https://user-sync.adhese.com/iframe/user_sync.html?account=demo&gdpr=1&consentString=CONSENT_STRING' } ] ) ;
45
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , serverResponses , gdprConsent ) ) . to . deep . equal ( [ { type : 'iframe' , url : 'https://user-sync.adhese.com/iframe/user_sync.html?account=demo&gdpr=1&consentString=CONSENT_STRING' } ] ) ;
40
46
} ) ;
41
47
} ) ;
42
48
0 commit comments