Skip to content

Commit

Permalink
Shorten SomoAudience to just Somo (#4163)
Browse files Browse the repository at this point in the history
* Shorten SomoAudience to just Somo

* Make package-lock return
  • Loading branch information
SuprPhatAnon authored and bretg committed Sep 8, 2019
1 parent 2bdbb12 commit 02cd6e4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 47 deletions.
28 changes: 3 additions & 25 deletions modules/somoaudienceBidAdapter.js → modules/somoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const APP_TARGETING = ['name', 'bundle', 'domain', 'storeUrl', 'cat', 'ver', 'ke

export const spec = {

code: 'somoaudience',
code: 'somo',

supportedMediaTypes: [BANNER, VIDEO],
aliases: ['somo'],
aliases: ['somoaudience'],

isBidRequestValid: bid => (
!!(bid && bid.params && bid.params.placementId)
Expand All @@ -25,29 +25,7 @@ export const spec = {
buildRequests: function(bidRequests, bidderRequest) {
return bidRequests.map(bidRequest => {
let da = openRtbRequest(bidRequest, bidderRequest);
if (window.top1 && window.top1.realvu_aa) {
let a = window.top1.realvu_aa.check({
unit_id: bidRequest.adUnitCode,
size: bidRequest.sizes,
partner_id: 'E321'
});
a.rq_bids.push({
bidder: bidRequest.bidder,
adId: bidRequest.bidId,
partner_id: 'E321'
});
if (a.riff == 'yes') {
da.imp[0].pmp = {
private_auction: 0,
deals: [
{
id: 'realvu',
bidfloor: 1.5
}
]
};
}
}

return {
method: 'POST',
url: '//publisher-east.mobileadtrading.com/rtb/bid?s=' + bidRequest.params.placementId.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Maintainer**: [email protected]
# Description
Connects to Somo Audience demand source.
Please use ```somoaudience``` as the bidder code.
Please use ```somo``` as the bidder code.

For video integration, somoAudience returns content as vastXML and requires the publisher to define the cache url in config passed to Prebid for it to be valid in the auction
# Test Site Parameters
Expand All @@ -14,7 +14,7 @@ For video integration, somoAudience returns content as vastXML and requires the
code: 'banner-ad-div',
sizes: [[300, 250]],
bids: [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: '22a58cfb0c9b656bff713d1236e930e8'
}
Expand All @@ -27,7 +27,7 @@ var adUnits = [{
code: 'banner-ad-div',
sizes: [[300, 250]],
bids: [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: '22a58cfb0c9b656bff713d1236e930e8',
app: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {expect} from 'chai';
import {spec} from 'modules/somoaudienceBidAdapter';
import {spec} from 'modules/somoBidAdapter';
import * as utils from 'src/utils';

describe('Somo Audience Adapter Tests', function () {
describe('isBidRequestValid', function () {
it('should return false when given an invalid bid', function () {
const bid = {
bidder: 'somoaudience',
bidder: 'somo',
};
const isValid = spec.isBidRequestValid(bid);
expect(isValid).to.equal(false);
});
it('should return true when given a placementId bid', function () {
const bid = {
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test'
}
Expand All @@ -27,7 +27,7 @@ describe('Somo Audience Adapter Tests', function () {
describe('buildBannerRequests', function () {
it('should properly build a banner request with type not defined and sizes not defined', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test'
}
Expand All @@ -49,7 +49,7 @@ describe('Somo Audience Adapter Tests', function () {

it('should properly build a banner request with sizes defined in 2d array', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
sizes: [[300, 250]],
params: {
placementId: 'test'
Expand All @@ -71,7 +71,7 @@ describe('Somo Audience Adapter Tests', function () {
});
it('should properly build a banner request with sizes defined in 1d array', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
sizes: [300, 250],
params: {
placementId: 'test'
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('Somo Audience Adapter Tests', function () {
it('should populate optional banner parameters', function () {
const bidRequests = [
{
bidder: 'somoaudience',
bidder: 'somo',
sizes: [[300, 200]],
mediaType: 'banner',
params: {
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('Somo Audience Adapter Tests', function () {
describe('buildVideoRequests', function () {
it('should properly build a video request with sizes defined', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
mediaTypes: {
video: {}
},
Expand All @@ -151,7 +151,7 @@ describe('Somo Audience Adapter Tests', function () {

it('should properly build a video request with sizes defined in 2d array', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
mediaTypes: {
video: {}
},
Expand All @@ -173,7 +173,7 @@ describe('Somo Audience Adapter Tests', function () {
});
it('should properly build a video request with sizes not defined', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
mediaType: 'video',
params: {
placementId: 'test'
Expand All @@ -199,7 +199,7 @@ describe('Somo Audience Adapter Tests', function () {
it('should populate optional video parameters', function () {
const bidRequests = [
{
bidder: 'somoaudience',
bidder: 'somo',
sizes: [[200, 300]],
mediaType: 'video',
params: {
Expand Down Expand Up @@ -242,7 +242,7 @@ describe('Somo Audience Adapter Tests', function () {
describe('buildSiteRequests', function () {
it('should fill in basic site parameters', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test'
}
Expand All @@ -258,7 +258,7 @@ describe('Somo Audience Adapter Tests', function () {

it('should fill in optional site parameters', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test',
site: {
Expand All @@ -285,7 +285,7 @@ describe('Somo Audience Adapter Tests', function () {
describe('buildAppRequests', function () {
it('should fill in app parameters', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test',
app: {
Expand Down Expand Up @@ -325,7 +325,7 @@ describe('Somo Audience Adapter Tests', function () {

it('should properly build request with gdpr consent', function () {
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test'
}
Expand All @@ -342,7 +342,7 @@ describe('Somo Audience Adapter Tests', function () {
it('should properly build request with gdpr not applies', function () {
bidderRequest.gdprConsent.gdprApplies = false;
const bidRequests = [{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test'
}
Expand All @@ -362,7 +362,7 @@ describe('Somo Audience Adapter Tests', function () {
it('should populate optional parameters', function () {
const bidRequests = [
{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test',
bcat: ['IAB-2', 'IAB-7'],
Expand All @@ -389,7 +389,7 @@ describe('Somo Audience Adapter Tests', function () {
it('Verify banner parse response', function () {
const bidRequests = [
{
bidder: 'somoaudience',
bidder: 'somo',
params: {
placementId: 'test',
},
Expand Down Expand Up @@ -417,7 +417,7 @@ describe('Somo Audience Adapter Tests', function () {
it('Verify video parse response', function () {
const bidRequests = [
{
bidder: 'somoaudience',
bidder: 'somo',
mediaTypes: {
video: {
}
Expand Down

0 comments on commit 02cd6e4

Please sign in to comment.