@@ -1450,28 +1450,64 @@ describe('OpenxAdapter', function () {
1450
1450
describe ( 'user sync' , function ( ) {
1451
1451
const syncUrl = 'http://testpixels.net' ;
1452
1452
1453
- it ( 'should register the pixel iframe from banner ad response' , function ( ) {
1454
- let syncs = spec . getUserSyncs (
1455
- { iframeEnabled : true } ,
1456
- [ { body : { ads : { pixels : syncUrl } } } ]
1457
- ) ;
1458
- expect ( syncs ) . to . deep . equal ( [ { type : 'iframe' , url : syncUrl } ] ) ;
1453
+ describe ( 'iframe sync' , function ( ) {
1454
+ it ( 'should register the pixel iframe from banner ad response' , function ( ) {
1455
+ let syncs = spec . getUserSyncs (
1456
+ { iframeEnabled : true } ,
1457
+ [ { body : { ads : { pixels : syncUrl } } } ]
1458
+ ) ;
1459
+ expect ( syncs ) . to . deep . equal ( [ { type : 'iframe' , url : syncUrl } ] ) ;
1460
+ } ) ;
1461
+
1462
+ it ( 'should register the pixel iframe from video ad response' , function ( ) {
1463
+ let syncs = spec . getUserSyncs (
1464
+ { iframeEnabled : true } ,
1465
+ [ { body : { pixels : syncUrl } } ]
1466
+ ) ;
1467
+ expect ( syncs ) . to . deep . equal ( [ { type : 'iframe' , url : syncUrl } ] ) ;
1468
+ } ) ;
1469
+
1470
+ it ( 'should register the default iframe if no pixels available' , function ( ) {
1471
+ let syncs = spec . getUserSyncs (
1472
+ { iframeEnabled : true } ,
1473
+ [ ]
1474
+ ) ;
1475
+ expect ( syncs ) . to . deep . equal ( [ { type : 'iframe' , url : '//u.openx.net/w/1.0/pd' } ] ) ;
1476
+ } ) ;
1459
1477
} ) ;
1460
1478
1461
- it ( 'should register the pixel iframe from video ad response' , function ( ) {
1462
- let syncs = spec . getUserSyncs (
1463
- { iframeEnabled : true } ,
1464
- [ { body : { pixels : syncUrl } } ]
1465
- ) ;
1466
- expect ( syncs ) . to . deep . equal ( [ { type : 'iframe' , url : syncUrl } ] ) ;
1479
+ describe ( 'pixel sync' , function ( ) {
1480
+ it ( 'should register the image pixel from banner ad response' , function ( ) {
1481
+ let syncs = spec . getUserSyncs (
1482
+ { pixelEnabled : true } ,
1483
+ [ { body : { ads : { pixels : syncUrl } } } ]
1484
+ ) ;
1485
+ expect ( syncs ) . to . deep . equal ( [ { type : 'image' , url : syncUrl } ] ) ;
1486
+ } ) ;
1487
+
1488
+ it ( 'should register the image pixel from video ad response' , function ( ) {
1489
+ let syncs = spec . getUserSyncs (
1490
+ { pixelEnabled : true } ,
1491
+ [ { body : { pixels : syncUrl } } ]
1492
+ ) ;
1493
+ expect ( syncs ) . to . deep . equal ( [ { type : 'image' , url : syncUrl } ] ) ;
1494
+ } ) ;
1495
+
1496
+ it ( 'should register the default image pixel if no pixels available' , function ( ) {
1497
+ let syncs = spec . getUserSyncs (
1498
+ { pixelEnabled : true } ,
1499
+ [ ]
1500
+ ) ;
1501
+ expect ( syncs ) . to . deep . equal ( [ { type : 'image' , url : '//u.openx.net/w/1.0/pd' } ] ) ;
1502
+ } ) ;
1467
1503
} ) ;
1468
1504
1469
- it ( 'should register the default iframe if no pixels available ' , function ( ) {
1505
+ it ( 'should prioritize iframe over image for user sync ' , function ( ) {
1470
1506
let syncs = spec . getUserSyncs (
1471
- { iframeEnabled : true } ,
1472
- [ ]
1507
+ { iframeEnabled : true , pixelEnabled : true } ,
1508
+ [ { body : { ads : { pixels : syncUrl } } } ]
1473
1509
) ;
1474
- expect ( syncs ) . to . deep . equal ( [ { type : 'iframe' , url : '//u.openx.net/w/1.0/pd' } ] ) ;
1510
+ expect ( syncs ) . to . deep . equal ( [ { type : 'iframe' , url : syncUrl } ] ) ;
1475
1511
} ) ;
1476
1512
} ) ;
1477
1513
0 commit comments