Skip to content

Commit

Permalink
[InvibesBidAdapter] fixed tests for new alg & reordered adapter checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rcheptanariu committed Aug 17, 2020
1 parent 25be9eb commit 0410982
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions modules/invibesBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,10 @@ function readGdprConsent(gdprConsent) {

let invibesVendorId = CONSTANTS.INVIBES_VENDOR_ID.toString(10);
let vendorConsents = getVendorConsents(gdprConsent.vendorData);
if (vendorConsents[invibesVendorId] === false) { return 0; }

if (vendorConsents == null || vendorConsents[invibesVendorId] == null) { return 4; }

if (vendorConsents[invibesVendorId] === false) { return 0; }

return 2;
}

Expand Down
16 changes: 8 additions & 8 deletions test/spec/modules/invibesBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ describe('invibesBidAdapter:', function () {
expect(request.data.oi).to.equal(0);
});

it('should send oi = 0 when purpose consents weren\'t approved on tcf v2', function () {
it('should send oi = 2 when purpose consents weren\'t approved on tcf v2', function () {
let bidderRequest = {
gdprConsent: {
vendorData: {
Expand All @@ -375,10 +375,10 @@ describe('invibesBidAdapter:', function () {
}
};
let request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data.oi).to.equal(0);
expect(request.data.oi).to.equal(2);
});

it('should send oi = 0 when purpose consents are less then 10 on tcf v2', function () {
it('should send oi = 2 when purpose consents are less then 10 on tcf v2', function () {
let bidderRequest = {
gdprConsent: {
vendorData: {
Expand All @@ -398,7 +398,7 @@ describe('invibesBidAdapter:', function () {
}
};
let request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data.oi).to.equal(0);
expect(request.data.oi).to.equal(2);
});

it('should send oi = 4 when vendor consents are null on tcf v2', function () {
Expand Down Expand Up @@ -533,7 +533,7 @@ describe('invibesBidAdapter:', function () {
expect(request.data.oi).to.equal(2);
});

it('should send oi = 0 when purpose consents weren\'t approved on tcf v1', function () {
it('should send oi = 2 when purpose consents weren\'t approved on tcf v1', function () {
let bidderRequest = {
gdprConsent: {
vendorData: {
Expand All @@ -551,10 +551,10 @@ describe('invibesBidAdapter:', function () {
}
};
let request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data.oi).to.equal(0);
expect(request.data.oi).to.equal(2);
});

it('should send oi = 0 when purpose consents are less then 5 on tcf v1', function () {
it('should send oi = 2 when purpose consents are less then 5 on tcf v1', function () {
let bidderRequest = {
gdprConsent: {
vendorData: {
Expand All @@ -570,7 +570,7 @@ describe('invibesBidAdapter:', function () {
}
};
let request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data.oi).to.equal(0);
expect(request.data.oi).to.equal(2);
});

it('should send oi = 0 when vendor consents for invibes are false on tcf v1', function () {
Expand Down

0 comments on commit 0410982

Please sign in to comment.