@@ -3,6 +3,7 @@ import {spec} from 'modules/stroeerCoreBidAdapter.js';
3
3
import * as utils from 'src/utils.js' ;
4
4
import { BANNER , VIDEO } from '../../../src/mediaTypes.js' ;
5
5
import { find } from 'src/polyfill.js' ;
6
+ import sinon from 'sinon' ;
6
7
7
8
describe ( 'stroeerCore bid adapter' , function ( ) {
8
9
let sandbox ;
@@ -51,8 +52,6 @@ describe('stroeerCore bid adapter', function () {
51
52
assert . notProperty ( bidObject , 'ad' ) ;
52
53
}
53
54
54
- const AUCTION_ID = utils . getUniqueIdentifierStr ( ) ;
55
-
56
55
// Vendor user ids and associated data
57
56
const userIds = Object . freeze ( {
58
57
criteoId : 'criteo-user-id' ,
@@ -72,7 +71,6 @@ describe('stroeerCore bid adapter', function () {
72
71
} ) ;
73
72
74
73
const buildBidderRequest = ( ) => ( {
75
- auctionId : AUCTION_ID ,
76
74
bidderRequestId : 'bidder-request-id-123' ,
77
75
bidderCode : 'stroeerCore' ,
78
76
timeout : 5000 ,
@@ -394,14 +392,18 @@ describe('stroeerCore bid adapter', function () {
394
392
clock . tick ( 13500 ) ;
395
393
const bidReq = buildBidderRequest ( ) ;
396
394
395
+ const UUID = 'fb6a39e3-083f-424c-9046-f1095e15f3d5' ;
396
+
397
+ const generateUUIDStub = sinon . stub ( utils , 'generateUUID' ) . returns ( UUID ) ;
398
+
397
399
const serverRequestInfo = spec . buildRequests ( bidReq . bids , bidReq ) ;
398
400
399
401
const expectedTimeout = bidderRequest . timeout - ( 13500 - bidderRequest . auctionStart ) ;
400
402
401
403
assert . equal ( expectedTimeout , 1500 ) ;
402
404
403
405
const expectedJsonPayload = {
404
- 'id' : AUCTION_ID ,
406
+ 'id' : UUID ,
405
407
'timeout' : expectedTimeout ,
406
408
'ref' : 'https://www.example.com/?search=monkey' ,
407
409
'mpa' : true ,
@@ -429,8 +431,9 @@ describe('stroeerCore bid adapter', function () {
429
431
430
432
// trim away fields with undefined
431
433
const actualJsonPayload = JSON . parse ( JSON . stringify ( serverRequestInfo . data ) ) ;
432
-
433
434
assert . deepEqual ( actualJsonPayload , expectedJsonPayload ) ;
435
+
436
+ generateUUIDStub . restore ( ) ;
434
437
} ) ;
435
438
436
439
describe ( 'video bids' , ( ) => {
0 commit comments