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

The Media Grid: fix tmax value #9339

Merged
merged 1 commit into from
Dec 20, 2022
Merged
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
3 changes: 1 addition & 2 deletions modules/gridBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ export const spec = {
let {bidderRequestId, auctionId, gdprConsent, uspConsent, timeout, refererInfo} = bidderRequest || {};

const referer = refererInfo ? encodeURIComponent(refererInfo.page) : '';
const bidderTimeout = config.getConfig('bidderTimeout') || timeout;
const tmax = timeout ? Math.min(bidderTimeout, timeout) : bidderTimeout;
const tmax = timeout || config.getConfig('bidderTimeout');
const imp = [];
const bidsMap = {};
const requests = [];
Expand Down
18 changes: 0 additions & 18 deletions test/spec/modules/gridBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,24 +840,6 @@ describe('TheMediaGrid Adapter', function () {
expect(payload.site.content.id).to.equal(contentId);
});

it('should be right tmax when timeout in config is less then timeout in bidderRequest', function() {
const getConfigStub = sinon.stub(config, 'getConfig').callsFake(
arg => arg === 'bidderTimeout' ? 2000 : null);
const [request] = spec.buildRequests([bidRequests[0]], bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload.tmax).to.equal(2000);
getConfigStub.restore();
});
it('should be right tmax when timeout in bidderRequest is less then timeout in config', function() {
const getConfigStub = sinon.stub(config, 'getConfig').callsFake(
arg => arg === 'bidderTimeout' ? 5000 : null);
const [request] = spec.buildRequests([bidRequests[0]], bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload.tmax).to.equal(3000);
getConfigStub.restore();
});
it('should contain regs.coppa if coppa is true in config', function () {
const getConfigStub = sinon.stub(config, 'getConfig').callsFake(
arg => arg === 'coppa' ? true : null);
Expand Down