Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test case for missing adomain in ix adapter #5422

Merged
merged 4 commits into from
Jul 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,35 @@ describe('IndexexchangeAdapter', function () {
]
};

const DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN = {
cur: 'USD',
id: '11a22b33c44d',
seatbid: [
{
bid: [
{
crid: '12345',
adid: '14851455',
impid: '1a2b3c4d',
cid: '3051266',
price: 100,
w: 300,
h: 250,
id: '1',
ext: {
dspid: 50,
pricelevel: '_100',
advbrandid: 303325,
advbrand: 'OECTA'
},
adm: '<a target="_blank" href="https://www.indexexchange.com"></a>'
}
],
seat: '3970'
}
]
};

const DEFAULT_VIDEO_BID_RESPONSE = {
cur: 'USD',
id: '1aa2bb3cc4de',
Expand Down Expand Up @@ -844,6 +873,31 @@ describe('IndexexchangeAdapter', function () {
expect(result[0]).to.deep.equal(expectedParse[0]);
});

it('should get correct bid response for banner ad with missing adomain', function () {
const expectedParse = [
{
requestId: '1a2b3c4d',
cpm: 1,
creativeId: '12345',
width: 300,
height: 250,
mediaType: 'banner',
ad: '<a target="_blank" href="https://www.indexexchange.com"></a>',
currency: 'USD',
ttl: 300,
netRevenue: true,
dealId: undefined,
meta: {
networkId: 50,
brandId: 303325,
brandName: 'OECTA'
}
}
];
const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN }, { data: DEFAULT_BIDDER_REQUEST_DATA });
expect(result[0]).to.deep.equal(expectedParse[0]);
});

it('should set creativeId to default value if not provided', function () {
const bidResponse = utils.deepClone(DEFAULT_BANNER_BID_RESPONSE);
delete bidResponse.seatbid[0].bid[0].crid;
Expand Down