@@ -134,4 +134,39 @@ describe('vrtcalBidAdapter', function () {
134
134
) . to . be . true
135
135
} )
136
136
} )
137
+
138
+ describe ( 'getUserSyncs' , function ( ) {
139
+ const syncurl_iframe = 'https://usync.vrtcal.com/i?ssp=1804&synctype=iframe' ;
140
+ const syncurl_redirect = 'https://usync.vrtcal.com/i?ssp=1804&synctype=redirect' ;
141
+
142
+ it ( 'base iframe sync pper config' , function ( ) {
143
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , { } , undefined , undefined ) ) . to . deep . equal ( [ {
144
+ type : 'iframe' , url : syncurl_iframe + '&us_privacy=&gdpr=0&gdpr_consent=&gpp=&gpp_sid=&surl='
145
+ } ] ) ;
146
+ } ) ;
147
+
148
+ it ( 'base redirect sync per config' , function ( ) {
149
+ expect ( spec . getUserSyncs ( { iframeEnabled : false } , { } , undefined , undefined ) ) . to . deep . equal ( [ {
150
+ type : 'image' , url : syncurl_redirect + '&us_privacy=&gdpr=0&gdpr_consent=&gpp=&gpp_sid=&surl='
151
+ } ] ) ;
152
+ } ) ;
153
+
154
+ it ( 'pass with ccpa data' , function ( ) {
155
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , { } , undefined , 'ccpa_consent_string' , undefined ) ) . to . deep . equal ( [ {
156
+ type : 'iframe' , url : syncurl_iframe + '&us_privacy=ccpa_consent_string&gdpr=0&gdpr_consent=&gpp=&gpp_sid=&surl='
157
+ } ] ) ;
158
+ } ) ;
159
+
160
+ it ( 'pass with gdpr data' , function ( ) {
161
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , { } , { gdprApplies : 1 , consentString : 'gdpr_consent_string' } , undefined , undefined ) ) . to . deep . equal ( [ {
162
+ type : 'iframe' , url : syncurl_iframe + '&us_privacy=&gdpr=1&gdpr_consent=gdpr_consent_string&gpp=&gpp_sid=&surl='
163
+ } ] ) ;
164
+ } ) ;
165
+
166
+ it ( 'pass with gpp data' , function ( ) {
167
+ expect ( spec . getUserSyncs ( { iframeEnabled : true } , { } , undefined , undefined , { gppString : 'gpp_consent_string' , applicableSections : [ 1 , 5 ] } ) ) . to . deep . equal ( [ {
168
+ type : 'iframe' , url : syncurl_iframe + '&us_privacy=&gdpr=0&gdpr_consent=&gpp=gpp_consent_string&gpp_sid=1,5&surl='
169
+ } ] ) ;
170
+ } ) ;
171
+ } )
137
172
} )
0 commit comments