@@ -924,11 +924,12 @@ describe('AdManager', function() {
924
924
} ) ;
925
925
926
926
describe ( '#configureAd' , function ( ) {
927
- var adSlot1 , container1 ;
927
+ var adSlot1 , container1 , sizes ;
928
928
929
929
beforeEach ( function ( ) {
930
+ sizes = adManager . adUnits . units . header . sizes ;
930
931
TestHelper . stub ( adManager , 'getAdUnitCode' ) . returns ( '/4246/fmg.onion' ) ;
931
- TestHelper . stub ( adManager , 'buildSizeMap ' ) . returns ( adManager . adUnits . units . header . sizes ) ;
932
+ TestHelper . stub ( adManager , 'adUnitSizes ' ) . returns ( sizes ) ;
932
933
container1 = document . createElement ( 'div' ) ;
933
934
adSlot1 = document . createElement ( 'div' ) ;
934
935
adSlot1 . className = 'dfp' ;
@@ -970,7 +971,6 @@ describe('AdManager', function() {
970
971
TestHelper . stub ( adManager , 'generateId' ) . returns ( 'dfp-ad-1' ) ;
971
972
TestHelper . stub ( window . googletag , 'pubads' ) . returns ( 'Stub pub ads' ) ;
972
973
slotStub = {
973
- defineSizeMapping : sinon . spy ( ) ,
974
974
addService : sinon . spy ( ) ,
975
975
setTargeting : function ( ) { }
976
976
} ;
@@ -985,11 +985,11 @@ describe('AdManager', function() {
985
985
} ) ;
986
986
987
987
it ( '- defines the slot on the google tag object' , function ( ) {
988
- expect ( window . googletag . defineSlot . calledWith ( '/4246/fmg.onion' , [ ] , 'dfp-ad-1' ) ) . to . be . true ;
988
+ expect ( window . googletag . defineSlot . calledWith ( '/4246/fmg.onion' , sizes , 'dfp-ad-1' ) ) . to . be . true ;
989
989
} ) ;
990
990
991
- it ( '- defines the size mapping on the google tag object' , function ( ) {
992
- expect ( slotStub . defineSizeMapping . calledWith ( adManager . adUnits . units . header . sizes ) ) . to . be . true ;
991
+ it ( '- defines activeSizes mapped to the google tag object' , function ( ) {
992
+ expect ( slotStub . activeSizes ) . to . deep . equal ( sizes ) ;
993
993
} ) ;
994
994
995
995
it ( '- returns the configured slot and adds it to the slots object' , function ( ) {
@@ -1007,7 +1007,6 @@ describe('AdManager', function() {
1007
1007
TestHelper . stub ( adManager , 'generateId' ) . returns ( 'dfp-ad-1' ) ;
1008
1008
TestHelper . stub ( window . googletag , 'pubads' ) . returns ( 'Stub pub ads' ) ;
1009
1009
slotStub = {
1010
- defineSizeMapping : sinon . spy ( ) ,
1011
1010
addService : sinon . spy ( ) ,
1012
1011
setTargeting : function ( ) { }
1013
1012
} ;
@@ -1020,7 +1019,7 @@ describe('AdManager', function() {
1020
1019
} ) ;
1021
1020
1022
1021
it ( '- defines the slot on the google tag object' , function ( ) {
1023
- expect ( window . googletag . defineSlot . calledWith ( '/4246/fmg.onion/front' , [ ] , 'dfp-ad-1' ) ) . to . be . true ;
1022
+ expect ( window . googletag . defineSlot . calledWith ( '/4246/fmg.onion/front' , sizes , 'dfp-ad-1' ) ) . to . be . true ;
1024
1023
} ) ;
1025
1024
1026
1025
it ( '- sets whether the ad should be eager loaded' , function ( ) {
@@ -1457,7 +1456,7 @@ describe('AdManager', function() {
1457
1456
var setupRefs = adSlotSetup ( ) ;
1458
1457
adSlot = setupRefs . adSlot1 ;
1459
1458
} ) ;
1460
-
1459
+
1461
1460
it ( '- calls fetchIasTargeting when enabled' , function ( ) {
1462
1461
adManager = AdManagerWrapper . init ( { iasEnabled : true } ) ;
1463
1462
TestHelper . stub ( adManager , 'fetchIasTargeting' ) ;
0 commit comments