Skip to content

Commit

Permalink
Smartico Bid Adapter: Add meta fields to interpreted response object (#…
Browse files Browse the repository at this point in the history
…7203)

* Adding smartico adapter

* bug #6486 fix, added maintainer email

* bug #6486 fix, modified test parameters

* bug #6486 fix, modified test parameters #2

* #6486 applied review related updates & fixes

* #6486 applied review related updates & fixes #2

* #6486 applied review related updates & fixes #3

* samrtico adapter bug fix

* smartico adapter unit test update after bug fixing

* smartico adapter bug fix #2

* smartico adapter bug fix #3

* fix linting errors

* update for version 5.0: meta.advertiserDomains is added

* update for version 5.0: meta.advertiserDomains is added (unit test) update

* Update smarticoBidAdapter_spec.js

Co-authored-by: Dmitri <[email protected]>
Co-authored-by: Chris Huie <[email protected]>
Co-authored-by: Patrick McCann <[email protected]>
  • Loading branch information
4 people authored Jul 22, 2021
1 parent df23aec commit b4c2552
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion modules/smarticoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ export const spec = {
netRevenue: !!ad.netRevenue,
currency: ad.currency,
ttl: ad.ttl,
ad: html
ad: html,
meta: {
advertiserDomains: ad.domains,
advertiserName: ad.title
}
}
bidResponses.push(bidObject);
}
Expand Down
13 changes: 11 additions & 2 deletions test/spec/modules/smarticoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ describe('smarticoBidAdapter', function () {
ttl: 30,
bannerFormatWidth: 300,
bannerFormatHeight: 250,
bannerFormatAlias: 'medium_rectangle'
bannerFormatAlias: 'medium_rectangle',
domains: ['www.advertiser.com'],
title: 'Advertiser'
}]
};
let expectedResponse = [{
Expand All @@ -93,7 +95,11 @@ describe('smarticoBidAdapter', function () {
currency: 'EUR',
netRevenue: false, // gross
ttl: 30,
ad: '<script id="smartico-widget-testPlacementId-0" async defer type="text/javascript" src="https://trmads.eu/get?token=FNVzUGZn9ebpIOoheh3kEJ2GQ6H6IyMH39sHXaya&auction-id=5kaj89l8-3456-2s56-c455-4g6h78jsdfgf&from-auction-buffer=1&own_session=1&ad=987654&scriptid=smartico-widget-testPlacementId-0&banner-format=medium_rectangle"><\/script>'}];
ad: '<script id="smartico-widget-testPlacementId-0" async defer type="text/javascript" src="https://trmads.eu/get?token=FNVzUGZn9ebpIOoheh3kEJ2GQ6H6IyMH39sHXaya&auction-id=5kaj89l8-3456-2s56-c455-4g6h78jsdfgf&from-auction-buffer=1&own_session=1&ad=987654&scriptid=smartico-widget-testPlacementId-0&banner-format=medium_rectangle"><\/script>',
meta: {
advertiserDomains: ['www.advertiser.com'],
advertiserName: 'Advertiser'
}}];
let result = spec.interpretResponse(serverResponse, bidRequest);
it('should contain correct creativeId', function () {
expect(result[0].creativeId).to.equal(expectedResponse[0].creativeId)
Expand Down Expand Up @@ -122,5 +128,8 @@ describe('smarticoBidAdapter', function () {
it('should contain correct ad content', function () {
expect(result[0].ad).to.equal(expectedResponse[0].ad)
});
it('should contain correct meta content', function () {
expect(result[0].meta).to.deep.equal(expectedResponse[0].meta)
});
});
});

0 comments on commit b4c2552

Please sign in to comment.