Skip to content

Commit

Permalink
Update viantOrtbBidAdapter_spec.js
Browse files Browse the repository at this point in the history
Added a test case for native ads
  • Loading branch information
tkrishnaviant authored Jan 3, 2024
1 parent 04a7659 commit c1fb48f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/spec/modules/viantOrtbBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,49 @@ describe('viantOrtbBidAdapter', function () {
});
});
});

describe('native', function () {
describe('and request config uses mediaTypes', () => {
function makeBid() {
return {
'bidder': 'viant',
'params': {
'unit': '12345678',
'delDomain': 'test-del-domain',
'publisherId': '464',
'placementId': 'some-PlacementId_2'
},
'mediaTypes': {
'video': {
'context': 'instream',
'playerSize': [[640, 480]],
'mimes': ['video/mp4'],
'protocols': [1, 2, 3, 4, 5, 6, 7, 8],
'api': [1, 3],
'skip': 1,
'skipafter': 5,
'minduration': 10,
'maxduration': 30
}
},
'adUnitCode': 'adunit-code',
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475',
'transactionId': '4008d88a-8137-410b-aa35-fbfdabcb478e'
}
}
it('should return true when required params found', function () {
expect(spec.isBidRequestValid(makeBid())).to.equal(true);
});

it('should return false when required params are not passed', function () {
let nativeBidWithMediaTypes = Object.assign({}, makeBid());
nativeBidWithMediaTypes.params = {};
expect(spec.isBidRequestValid(nativeBidWithMediaTypes)).to.equal(false);
});
});
});
});

describe('buildRequests-banner', function () {
Expand Down

0 comments on commit c1fb48f

Please sign in to comment.