Skip to content

Commit

Permalink
convert bidwon attributes to string (#10307)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieularere-msq authored Aug 2, 2023
1 parent b2ca20e commit f41c26a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/mediasquareBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ export const spec = {
paramsToSearchFor.forEach(param => {
if (bid['mediasquare'].hasOwnProperty(param)) {
params[param] = bid['mediasquare'][param];
if (typeof params[param] == 'number') {
params[param] = params[param].toString();
}
}
});
};
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/mediasquareBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {expect} from 'chai';
import {spec} from 'modules/mediasquareBidAdapter.js';
import { server } from 'test/mocks/xhr.js';

describe('MediaSquare bid adapter tests', function () {
var DEFAULT_PARAMS = [{
Expand Down Expand Up @@ -208,6 +209,10 @@ describe('MediaSquare bid adapter tests', function () {
const response = spec.interpretResponse(BID_RESPONSE, request);
const won = spec.onBidWon(response[0]);
expect(won).to.equal(true);
expect(server.requests.length).to.equal(1);
let message = JSON.parse(server.requests[0].requestBody);
expect(message).to.have.property('increment').exist;
expect(message).to.have.property('increment').and.to.equal('1');
});
it('Verifies user sync without cookie in bid response', function () {
var syncs = spec.getUserSyncs({}, [BID_RESPONSE], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
Expand Down

0 comments on commit f41c26a

Please sign in to comment.