Skip to content

Commit 9d8df5c

Browse files
add meta.mediaType (prebid#13022)
1 parent ae29ff9 commit 9d8df5c

2 files changed

Lines changed: 57 additions & 2 deletions

File tree

modules/seedtagBidAdapter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ function buildBidResponse(seedtagBid) {
176176
seedtagBid && seedtagBid.adomain && seedtagBid.adomain.length > 0
177177
? seedtagBid.adomain
178178
: [],
179+
mediaType: seedtagBid.realMediaType,
179180
},
180181
};
181182

test/spec/modules/seedtagBidAdapter_spec.js

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ describe('Seedtag Adapter', function () {
363363
expect(videoBid.requestCount).to.equal(1);
364364
});
365365

366-
it('should have geom parameters if slot is available', function() {
366+
it('should have geom parameters if slot is available', function () {
367367
const request = spec.buildRequests(validBidRequests, bidderRequest);
368368
const data = JSON.parse(request.data);
369369
const bidRequests = data.bidRequests;
@@ -392,7 +392,7 @@ describe('Seedtag Adapter', function () {
392392
}
393393
})
394394

395-
it('should have bidfloor parameter if available', function() {
395+
it('should have bidfloor parameter if available', function () {
396396
const request = spec.buildRequests(validBidRequests, bidderRequest);
397397
const data = JSON.parse(request.data);
398398
const bidRequests = data.bidRequests;
@@ -773,6 +773,60 @@ describe('Seedtag Adapter', function () {
773773
expect(bids[0].meta.advertiserDomains).to.deep.equal([]);
774774
});
775775
});
776+
describe('the bid is a banner but the content is a video or display (video)', function () {
777+
it('should return a banner bid with right meta.mediaType', function () {
778+
const request = { data: JSON.stringify({}) };
779+
const serverResponse = {
780+
body: {
781+
bids: [
782+
{
783+
bidId: '2159a54dc2566f',
784+
price: 0.5,
785+
currency: 'USD',
786+
content: 'content',
787+
width: 728,
788+
height: 90,
789+
mediaType: 'display',
790+
ttl: 360,
791+
nurl: 'testurl.com/nurl',
792+
adomain: ['advertiserdomain.com'],
793+
realMediaType: 'video'
794+
},
795+
],
796+
cookieSync: { url: '' },
797+
},
798+
};
799+
const bids = spec.interpretResponse(serverResponse, request);
800+
expect(bids.length).to.equal(1);
801+
expect(bids[0].meta.mediaType).to.deep.equal('video');
802+
});
803+
it('should return a banner bid with right meta.mediaType (display)', function () {
804+
const request = { data: JSON.stringify({}) };
805+
const serverResponse = {
806+
body: {
807+
bids: [
808+
{
809+
bidId: '2159a54dc2566f',
810+
price: 0.5,
811+
currency: 'USD',
812+
content: 'content',
813+
width: 728,
814+
height: 90,
815+
mediaType: 'display',
816+
ttl: 360,
817+
nurl: 'testurl.com/nurl',
818+
adomain: ['advertiserdomain.com'],
819+
realMediaType: 'banner'
820+
},
821+
],
822+
cookieSync: { url: '' },
823+
},
824+
};
825+
const bids = spec.interpretResponse(serverResponse, request);
826+
expect(bids.length).to.equal(1);
827+
expect(bids[0].meta.mediaType).to.deep.equal('banner');
828+
});
829+
});
776830
});
777831
});
778832

0 commit comments

Comments
 (0)