@@ -53,16 +53,18 @@ describe('RTBHouseAdapter', () => {
53
53
54
54
describe ( 'buildRequests' , function ( ) {
55
55
let bidRequests ;
56
- const bidderRequest = {
57
- 'refererInfo' : {
58
- 'numIframes' : 0 ,
59
- 'reachedTop' : true ,
60
- 'referer' : 'https://example.com' ,
61
- 'stack' : [ 'https://example.com' ]
62
- }
63
- } ;
56
+ let bidderRequest ;
64
57
65
58
beforeEach ( ( ) => {
59
+ bidderRequest = {
60
+ 'auctionId' : 'bidderrequest-auction-id' ,
61
+ 'refererInfo' : {
62
+ 'numIframes' : 0 ,
63
+ 'reachedTop' : true ,
64
+ 'referer' : 'https://example.com' ,
65
+ 'stack' : [ 'https://example.com' ]
66
+ }
67
+ } ;
66
68
bidRequests = [
67
69
{
68
70
'bidder' : 'rtbhouse' ,
@@ -82,6 +84,11 @@ describe('RTBHouseAdapter', () => {
82
84
'bidderRequestId' : '22edbae2733bf6' ,
83
85
'auctionId' : '1d1a030790a475' ,
84
86
'transactionId' : 'example-transaction-id' ,
87
+ 'ortb2Imp' : {
88
+ 'ext' : {
89
+ 'tid' : 'ortb2Imp-transaction-id-1'
90
+ }
91
+ } ,
85
92
'schain' : {
86
93
'ver' : '1.0' ,
87
94
'complete' : 1 ,
@@ -203,7 +210,7 @@ describe('RTBHouseAdapter', () => {
203
210
const bidRequest = Object . assign ( [ ] , bidRequests ) ;
204
211
const request = spec . buildRequests ( bidRequest , bidderRequest ) ;
205
212
const data = JSON . parse ( request . data ) ;
206
- expect ( data . source . tid ) . to . equal ( 'example-transaction -id' ) ;
213
+ expect ( data . source . tid ) . to . equal ( 'bidderrequest-auction -id' ) ;
207
214
} ) ;
208
215
209
216
it ( 'should include bidfloor from floor module if avaiable' , ( ) => {
@@ -256,6 +263,13 @@ describe('RTBHouseAdapter', () => {
256
263
expect ( data . source ) . to . have . deep . property ( 'tid' ) ;
257
264
} ) ;
258
265
266
+ it ( 'should include impression level transaction id when provided' , ( ) => {
267
+ const bidRequest = Object . assign ( [ ] , bidRequests ) ;
268
+ const request = spec . buildRequests ( bidRequest , bidderRequest ) ;
269
+ const data = JSON . parse ( request . data ) ;
270
+ expect ( data . imp [ 0 ] . ext . tid ) . to . equal ( 'ortb2Imp-transaction-id-1' ) ;
271
+ } ) ;
272
+
259
273
it ( 'should not include invalid schain' , ( ) => {
260
274
const bidRequest = Object . assign ( [ ] , bidRequests ) ;
261
275
bidRequest [ 0 ] . schain = {
0 commit comments