Skip to content

Commit 13a347a

Browse files
authored
add test case for missing adomain in ix adapter (#5422)
* add test case for missing adomain in ix adapter at request of @ix-prebid-support on #5404 * Update ixBidAdapter_spec.js * Update ixBidAdapter_spec.js * Update ixBidAdapter_spec.js
1 parent a8f394e commit 13a347a

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

test/spec/modules/ixBidAdapter_spec.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,35 @@ describe('IndexexchangeAdapter', function () {
110110
]
111111
};
112112

113+
const DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN = {
114+
cur: 'USD',
115+
id: '11a22b33c44d',
116+
seatbid: [
117+
{
118+
bid: [
119+
{
120+
crid: '12345',
121+
adid: '14851455',
122+
impid: '1a2b3c4d',
123+
cid: '3051266',
124+
price: 100,
125+
w: 300,
126+
h: 250,
127+
id: '1',
128+
ext: {
129+
dspid: 50,
130+
pricelevel: '_100',
131+
advbrandid: 303325,
132+
advbrand: 'OECTA'
133+
},
134+
adm: '<a target="_blank" href="https://www.indexexchange.com"></a>'
135+
}
136+
],
137+
seat: '3970'
138+
}
139+
]
140+
};
141+
113142
const DEFAULT_VIDEO_BID_RESPONSE = {
114143
cur: 'USD',
115144
id: '1aa2bb3cc4de',
@@ -844,6 +873,31 @@ describe('IndexexchangeAdapter', function () {
844873
expect(result[0]).to.deep.equal(expectedParse[0]);
845874
});
846875

876+
it('should get correct bid response for banner ad with missing adomain', function () {
877+
const expectedParse = [
878+
{
879+
requestId: '1a2b3c4d',
880+
cpm: 1,
881+
creativeId: '12345',
882+
width: 300,
883+
height: 250,
884+
mediaType: 'banner',
885+
ad: '<a target="_blank" href="https://www.indexexchange.com"></a>',
886+
currency: 'USD',
887+
ttl: 300,
888+
netRevenue: true,
889+
dealId: undefined,
890+
meta: {
891+
networkId: 50,
892+
brandId: 303325,
893+
brandName: 'OECTA'
894+
}
895+
}
896+
];
897+
const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN }, { data: DEFAULT_BIDDER_REQUEST_DATA });
898+
expect(result[0]).to.deep.equal(expectedParse[0]);
899+
});
900+
847901
it('should set creativeId to default value if not provided', function () {
848902
const bidResponse = utils.deepClone(DEFAULT_BANNER_BID_RESPONSE);
849903
delete bidResponse.seatbid[0].bid[0].crid;

0 commit comments

Comments
 (0)