@@ -99,6 +99,24 @@ describe('ttdBidAdapter', function () {
9999 bid . params . bidfloor = 3.01 ;
100100 expect ( spec . isBidRequestValid ( bid ) ) . to . equal ( true ) ;
101101 } ) ;
102+
103+ it ( 'should return false if customBidderEndpoint is provided and does not start with https://' , function ( ) {
104+ const bid = makeBid ( ) ;
105+ bid . params . customBidderEndpoint = 'customBidderEndpoint/bid/bidder/' ;
106+ expect ( spec . isBidRequestValid ( bid ) ) . to . equal ( false ) ;
107+ } ) ;
108+
109+ it ( 'should return false if customBidderEndpoint is provided and does not end with /bid/bidder/' , function ( ) {
110+ const bid = makeBid ( ) ;
111+ bid . params . customBidderEndpoint = 'https://customBidderEndpoint/bid/bidder' ;
112+ expect ( spec . isBidRequestValid ( bid ) ) . to . equal ( false ) ;
113+ } ) ;
114+
115+ it ( 'should return true if customBidderEndpoint is provided that starts with https:// and ends with /bid/bidder/' , function ( ) {
116+ const bid = makeBid ( ) ;
117+ bid . params . customBidderEndpoint = 'https://customBidderEndpoint/bid/bidder/' ;
118+ expect ( spec . isBidRequestValid ( bid ) ) . to . equal ( true ) ;
119+ } ) ;
102120 } ) ;
103121
104122 describe ( 'banner' , function ( ) {
@@ -306,11 +324,18 @@ describe('ttdBidAdapter', function () {
306324 expect ( url ) . to . equal ( 'https://direct.adsrvr.org/bid/bidder/supplier' ) ;
307325 } ) ;
308326
327+ it ( 'sends bid requests to the correct http2 endpoint' , function ( ) {
328+ const bannerBidRequestsWithHttp2Endpoint = deepClone ( baseBannerBidRequests ) ;
329+ bannerBidRequestsWithHttp2Endpoint [ 0 ] . params . useHttp2 = true ;
330+ const url = testBuildRequests ( bannerBidRequestsWithHttp2Endpoint , baseBidderRequest ) . url ;
331+ expect ( url ) . to . equal ( 'https://d2.adsrvr.org/bid/bidder/supplier' ) ;
332+ } ) ;
333+
309334 it ( 'sends bid requests to the correct custom endpoint' , function ( ) {
310335 const bannerBidRequestsWithCustomEndpoint = deepClone ( baseBannerBidRequests ) ;
311- bannerBidRequestsWithCustomEndpoint [ 0 ] . params . useHttp2 = true ;
336+ bannerBidRequestsWithCustomEndpoint [ 0 ] . params . customBidderEndpoint = 'https://customBidderEndpoint/bid/bidder/' ;
312337 const url = testBuildRequests ( bannerBidRequestsWithCustomEndpoint , baseBidderRequest ) . url ;
313- expect ( url ) . to . equal ( 'https://d2.adsrvr.org /bid/bidder/supplier' ) ;
338+ expect ( url ) . to . equal ( 'https://customBidderEndpoint /bid/bidder/supplier' ) ;
314339 } ) ;
315340
316341 it ( 'sends publisher id' , function ( ) {
0 commit comments