@@ -1531,7 +1531,7 @@ describe('AdManager', function() {
1531
1531
1532
1532
// Setup method utilized by #refreshSlot & #refreshSlots tests
1533
1533
function adSlotSetup ( ) {
1534
- var baseContainer , container1 , adSlot1 , stubSlot , variableReferences ;
1534
+ var baseContainer , container1 , adSlot1 , stubSlot , eagerStubSlot , variableReferences ;
1535
1535
baseContainer = document . createElement ( 'div' ) ;
1536
1536
container1 = document . createElement ( 'div' ) ;
1537
1537
container1 . className = 'expected' ;
@@ -1557,12 +1557,16 @@ describe('AdManager', function() {
1557
1557
setTargeting : function ( ) { } ,
1558
1558
getOutOfPage : function ( ) { return false ; }
1559
1559
} ;
1560
+
1561
+ eagerStubSlot = Object . assign ( { } , stubSlot , { eagerLoad : true } ) ;
1562
+
1560
1563
variableReferences = {
1561
1564
baseContainer : baseContainer ,
1562
1565
container1 : container1 ,
1563
1566
adSlot1 : adSlot1 ,
1564
- stubSlot : stubSlot
1565
- }
1567
+ stubSlot : stubSlot ,
1568
+ eagerStubSlot : eagerStubSlot
1569
+ } ;
1566
1570
1567
1571
adManager . slots = {
1568
1572
'dfp-ad-1' : stubSlot
@@ -1628,20 +1632,21 @@ describe('AdManager', function() {
1628
1632
} ) ;
1629
1633
1630
1634
context ( 'always' , function ( ) {
1631
- var adSlot , stubSlot , baseContainer ;
1635
+ var adSlot , stubSlot , eagerStubSlot , baseContainer ;
1632
1636
1633
1637
beforeEach ( function ( ) {
1634
1638
var setupRefs = adSlotSetup ( ) ;
1635
1639
adSlot = setupRefs . adSlot1 ;
1636
1640
stubSlot = setupRefs . stubSlot ;
1641
+ eagerStubSlot = setupRefs . eagerStubSlot ;
1637
1642
baseContainer = setupRefs . baseContainer ;
1638
1643
} ) ;
1639
1644
1640
1645
afterEach ( function ( ) {
1641
1646
$ ( baseContainer ) . remove ( ) ;
1642
1647
} ) ;
1643
1648
1644
- it ( 'always updates the correlator' , function ( ) {
1649
+ it ( 'updates the correlator when ad is not eager loaded ' , function ( ) {
1645
1650
adManager = AdManagerWrapper . init ( { iasEnabled : true } ) ;
1646
1651
TestHelper . stub ( adManager , 'fetchAmazonBids' ) ;
1647
1652
TestHelper . stub ( adManager , 'fetchIasTargeting' ) ;
@@ -1651,6 +1656,17 @@ describe('AdManager', function() {
1651
1656
1652
1657
expect ( adManager . googletag . pubads ( ) . updateCorrelator . called ) . to . be . true ;
1653
1658
} ) ;
1659
+
1660
+ it ( 'does not update the correlator when ad is eager loaded' , function ( ) {
1661
+ adManager = AdManagerWrapper . init ( { iasEnabled : true } ) ;
1662
+ TestHelper . stub ( adManager , 'fetchAmazonBids' ) ;
1663
+ TestHelper . stub ( adManager , 'fetchIasTargeting' ) ;
1664
+ TestHelper . stub ( adManager , 'setIndexTargetingForSlots' ) ;
1665
+
1666
+ adManager . refreshSlots ( [ eagerStubSlot ] ) ;
1667
+
1668
+ expect ( adManager . googletag . pubads ( ) . updateCorrelator . called ) . to . be . false ;
1669
+ } ) ;
1654
1670
} ) ;
1655
1671
1656
1672
context ( '> prebidEnabled' , function ( ) {
0 commit comments