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

feat(sublimeBidAdapter): modifying bid request contentType #25

Open
wants to merge 4 commits into
base: sublime-adapter-bundle
Choose a base branch
from
Open
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions modules/sublimeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { config } from '../src/config.js';
import * as utils from '../src/utils.js';

const BIDDER_CODE = 'sublime';
const BIDDER_GVLID = 114;
const DEFAULT_BID_HOST = 'pbjs.sskzlabs.com';
const DEFAULT_CALLBACK_NAME = 'sublime_prebid_callback';
const DEFAULT_CURRENCY = 'EUR';
const DEFAULT_PROTOCOL = 'https';
const DEFAULT_SAC_HOST = 'sac.ayads.co'
const DEFAULT_TTL = 600;
const SUBLIME_ANTENNA = 'antenna.ayads.co';
const SUBLIME_VERSION = '0.5.2-bundle';
const SUBLIME_VERSION = '0.6.1-bundle';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On ne serait pas plutôt sur une version 0.7.0 ? (pour être raccord avec le nouvel adapter)


/**
* Debug log message
Expand Down Expand Up @@ -186,10 +185,10 @@ function buildRequests(validBidRequests, bidderRequest) {
return {
method: 'POST',
url: protocol + '://' + bidHost + '/bid',
data: payload,
data: JSON.stringify(payload),
options: {
contentType: 'application/json',
withCredentials: true
contentType: 'text/plain',
withCredentials: false
},
}
});
Expand Down Expand Up @@ -272,6 +271,7 @@ function onTimeout(timeoutData) {
export const spec = {
code: BIDDER_CODE,
aliases: [],
sendEvent: sendEvent,
isBidRequestValid: isBidRequestValid,
buildRequests: buildRequests,
interpretResponse: interpretResponse,
Expand Down
13 changes: 7 additions & 6 deletions test/spec/modules/sublimeBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import { spec, sendEvent, log, setState, state } from 'modules/sublimeBidAdapter.js';
import { spec } from 'modules/sublimeBidAdapter.js';
import { newBidder } from 'src/adapters/bidderFactory.js';

let utils = require('src/utils');
Expand All @@ -16,7 +16,7 @@ describe('Sublime Adapter', function() {

it('should trigger pixel', function () {
sandbox.spy(utils, 'triggerPixel');
sendEvent('test', true);
spec.sendEvent('test', true);
expect(utils.triggerPixel.called).to.equal(true);
});

Expand Down Expand Up @@ -93,7 +93,8 @@ describe('Sublime Adapter', function() {
});

it('should contains a request id equals to the bid id', function() {
expect(request[0].data.requestId).to.equal(bidRequests[0].bidId);
const data = JSON.parse(request[0].data);
expect(data.requestId).to.equal(bidRequests[0].bidId);
});

it('should have an url that contains bid keyword', function() {
Expand Down Expand Up @@ -146,7 +147,7 @@ describe('Sublime Adapter', function() {
currency: 'USD',
netRevenue: true,
ttl: 600,
pbav: '0.5.2',
pbav: '0.6.1-bundle',
ad: '',
},
];
Expand Down Expand Up @@ -188,7 +189,7 @@ describe('Sublime Adapter', function() {
netRevenue: true,
ttl: 600,
ad: '<!-- Creative -->',
pbav: '0.5.2',
pbav: '0.6.1-bundle',
};

expect(result[0]).to.deep.equal(expectedResponse);
Expand Down Expand Up @@ -238,7 +239,7 @@ describe('Sublime Adapter', function() {
netRevenue: true,
ttl: 600,
ad: '<!-- ad -->',
pbav: '0.5.2',
pbav: '0.6.1-bundle',
};

expect(result[0]).to.deep.equal(expectedResponse);
Expand Down