Skip to content

Commit

Permalink
added tests for coppa config for gumgumBidAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bauzon-gumgum committed Nov 2, 2022
1 parent ddf5eb9 commit 151ad47
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BANNER, VIDEO } from 'src/mediaTypes.js';

import { config } from 'src/config.js';
import { expect } from 'chai';
import { newBidder } from 'src/adapters/bidderFactory.js';
import { spec } from 'modules/gumgumBidAdapter.js';
Expand Down Expand Up @@ -484,6 +485,20 @@ describe('gumgumAdapter', function () {
const bidRequest = spec.buildRequests(bidRequests, fakeBidRequest)[0];
expect(bidRequest.data).to.not.include.any.keys('gdprConsent')
});
it('should not set coppa parameter if coppa config is set to false', function () {
config.setConfig({
coppa: false
});
const bidRequest = spec.buildRequests(bidRequests)[0];
expect(bidRequest.data.coppa).to.eq(undefined);
});
it('should set coppa parameter to 1 if coppa config is set to true', function () {
config.setConfig({
coppa: true
});
const bidRequest = spec.buildRequests(bidRequests)[0];
expect(bidRequest.data.coppa).to.eq(1);
});
it('should add uspConsent parameter if it is present in the bidderRequest', function () {
const noUspBidRequest = spec.buildRequests(bidRequests)[0];
const uspConsentObj = { uspConsent: '1YYY' };
Expand Down

0 comments on commit 151ad47

Please sign in to comment.