Skip to content

Commit

Permalink
Revert "Relaido Bid Adapter: support imuid module (#7422)" (#7520)
Browse files Browse the repository at this point in the history
This reverts commit 0ee71d2.
  • Loading branch information
ChrisHuie committed Sep 30, 2021
1 parent 0ee71d2 commit d7fc1a7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
10 changes: 2 additions & 8 deletions modules/relaidoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'relaido';
const BIDDER_DOMAIN = 'api.relaido.jp';
const ADAPTER_VERSION = '1.0.6';
const ADAPTER_VERSION = '1.0.5';
const DEFAULT_TTL = 300;
const UUID_KEY = 'relaido_uuid';

Expand Down Expand Up @@ -68,15 +68,9 @@ function buildRequests(validBidRequests, bidderRequest) {
media_type: mediaType,
uuid: uuid,
width: width,
height: height,
pv: '$prebid.version$'
height: height
};

const imuid = utils.deepAccess(bidRequest, 'userId.imuid');
if (imuid) {
payload.imuid = imuid;
}

// It may not be encoded, so add it at the end of the payload
payload.ref = bidderRequest.refererInfo.referer;

Expand Down
40 changes: 20 additions & 20 deletions test/spec/modules/relaidoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ describe('RelaidoAdapter', function () {
let bidderRequest;
let serverResponse;
let serverRequest;
let generateUUIDStub;
let triggerPixelStub;

beforeEach(function () {
generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(relaido_uuid);
triggerPixelStub = sinon.stub(utils, 'triggerPixel');
bidRequest = {
bidder: 'relaido',
params: {
Expand Down Expand Up @@ -76,10 +72,6 @@ describe('RelaidoAdapter', function () {
mediaType: 'video',
};
});
afterEach(() => {
generateUUIDStub.restore();
triggerPixelStub.restore();
});

describe('spec.isBidRequestValid', function () {
it('should return true when the required params are passed by video', function () {
Expand Down Expand Up @@ -215,7 +207,6 @@ describe('RelaidoAdapter', function () {
expect(request.data.uuid).to.equal(relaido_uuid);
expect(request.data.width).to.equal(bidRequest.mediaTypes.video.playerSize[0][0]);
expect(request.data.height).to.equal(bidRequest.mediaTypes.video.playerSize[0][1]);
expect(request.data.pv).to.equal('$prebid.version$');
});

it('should build bid requests by banner', function () {
Expand Down Expand Up @@ -260,6 +251,8 @@ describe('RelaidoAdapter', function () {
expect(bidRequests).to.have.lengthOf(1);
const request = bidRequests[0];

// eslint-disable-next-line no-console
console.log(bidRequests);
expect(request.width).to.equal(1);
});

Expand All @@ -271,15 +264,6 @@ describe('RelaidoAdapter', function () {
expect(keys[0]).to.equal('version');
expect(keys[keys.length - 1]).to.equal('ref');
});

it('should get imuid', function () {
bidRequest.userId = {}
bidRequest.userId.imuid = 'i.tjHcK_7fTcqnbrS_YA2vaw';
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
expect(bidRequests).to.have.lengthOf(1);
const request = bidRequests[0];
expect(request.data.imuid).to.equal('i.tjHcK_7fTcqnbrS_YA2vaw');
});
});

describe('spec.interpretResponse', function () {
Expand Down Expand Up @@ -366,6 +350,14 @@ describe('RelaidoAdapter', function () {
});

describe('spec.onBidWon', function () {
let stub;
beforeEach(() => {
stub = sinon.stub(utils, 'triggerPixel');
});
afterEach(() => {
stub.restore();
});

it('Should create nurl pixel if bid nurl', function () {
let bid = {
bidder: bidRequest.bidder,
Expand All @@ -379,7 +371,7 @@ describe('RelaidoAdapter', function () {
ref: window.location.href,
}
spec.onBidWon(bid);
const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]);
const parser = utils.parseUrl(stub.getCall(0).args[0]);
const query = parser.search;
expect(parser.hostname).to.equal('api.relaido.jp');
expect(parser.pathname).to.equal('/tr/v1/prebid/win.gif');
Expand All @@ -395,6 +387,14 @@ describe('RelaidoAdapter', function () {
});

describe('spec.onTimeout', function () {
let stub;
beforeEach(() => {
stub = sinon.stub(utils, 'triggerPixel');
});
afterEach(() => {
stub.restore();
});

it('Should create nurl pixel if bid nurl', function () {
const data = [{
bidder: bidRequest.bidder,
Expand All @@ -405,7 +405,7 @@ describe('RelaidoAdapter', function () {
timeout: bidderRequest.timeout,
}];
spec.onTimeout(data);
const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]);
const parser = utils.parseUrl(stub.getCall(0).args[0]);
const query = parser.search;
expect(parser.hostname).to.equal('api.relaido.jp');
expect(parser.pathname).to.equal('/tr/v1/prebid/timeout.gif');
Expand Down

0 comments on commit d7fc1a7

Please sign in to comment.