@@ -1531,7 +1531,7 @@ describe('AdManager', function() {
15311531
15321532 // Setup method utilized by #refreshSlot & #refreshSlots tests
15331533 function adSlotSetup ( ) {
1534- var baseContainer , container1 , adSlot1 , stubSlot , variableReferences ;
1534+ var baseContainer , container1 , adSlot1 , stubSlot , eagerStubSlot , variableReferences ;
15351535 baseContainer = document . createElement ( 'div' ) ;
15361536 container1 = document . createElement ( 'div' ) ;
15371537 container1 . className = 'expected' ;
@@ -1557,12 +1557,16 @@ describe('AdManager', function() {
15571557 setTargeting : function ( ) { } ,
15581558 getOutOfPage : function ( ) { return false ; }
15591559 } ;
1560+
1561+ eagerStubSlot = Object . assign ( { } , stubSlot , { eagerLoad : true } ) ;
1562+
15601563 variableReferences = {
15611564 baseContainer : baseContainer ,
15621565 container1 : container1 ,
15631566 adSlot1 : adSlot1 ,
1564- stubSlot : stubSlot
1565- }
1567+ stubSlot : stubSlot ,
1568+ eagerStubSlot : eagerStubSlot
1569+ } ;
15661570
15671571 adManager . slots = {
15681572 'dfp-ad-1' : stubSlot
@@ -1628,20 +1632,21 @@ describe('AdManager', function() {
16281632 } ) ;
16291633
16301634 context ( 'always' , function ( ) {
1631- var adSlot , stubSlot , baseContainer ;
1635+ var adSlot , stubSlot , eagerStubSlot , baseContainer ;
16321636
16331637 beforeEach ( function ( ) {
16341638 var setupRefs = adSlotSetup ( ) ;
16351639 adSlot = setupRefs . adSlot1 ;
16361640 stubSlot = setupRefs . stubSlot ;
1641+ eagerStubSlot = setupRefs . eagerStubSlot ;
16371642 baseContainer = setupRefs . baseContainer ;
16381643 } ) ;
16391644
16401645 afterEach ( function ( ) {
16411646 $ ( baseContainer ) . remove ( ) ;
16421647 } ) ;
16431648
1644- it ( 'always updates the correlator' , function ( ) {
1649+ it ( 'updates the correlator when ad is not eager loaded ' , function ( ) {
16451650 adManager = AdManagerWrapper . init ( { iasEnabled : true } ) ;
16461651 TestHelper . stub ( adManager , 'fetchAmazonBids' ) ;
16471652 TestHelper . stub ( adManager , 'fetchIasTargeting' ) ;
@@ -1651,6 +1656,17 @@ describe('AdManager', function() {
16511656
16521657 expect ( adManager . googletag . pubads ( ) . updateCorrelator . called ) . to . be . true ;
16531658 } ) ;
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+ } ) ;
16541670 } ) ;
16551671
16561672 context ( '> prebidEnabled' , function ( ) {
0 commit comments