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

Replace preset targeting after setting winning bid targeting #411

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function getWinningBidTargeting() {
});

if (presetTargeting) {
winners.concat(presetTargeting);
winners = winners.concat(presetTargeting);
}

return winners;
Expand Down
10 changes: 9 additions & 1 deletion test/fixtures/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,18 @@ export function getTargetingKeys() {
"foobar",
"300x250"
],
[
"testKey",
"a test targeting value"
],
[
"foobar",
"300x250"
]
];
}

// Key/values used to set ad server targeting when bid landscape
// Key/values used to set ad server targeting when bid landscape
// targeting is on.
export function getTargetingKeysBidLandscape() {
return [
Expand All @@ -1159,6 +1163,10 @@ export function getTargetingKeysBidLandscape() {
"foobar",
"300x250"
],
[
"testKey",
"a test targeting value"
],
[
"foobar",
"300x250"
Expand Down
6 changes: 5 additions & 1 deletion test/spec/unit/pbjs_api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var Slot = function Slot(elementId, pathId) {
},

getTargeting: function getTargeting() {
return [{ testKey: ['a test targeting value'] }];
return {testKey: ['a test targeting value']}['testKey'];
},

getTargetingKeys: function getTargetingKeys() {
Expand Down Expand Up @@ -311,6 +311,10 @@ describe('Unit: Prebid Module', function () {
"foobar",
"300x250"
],
[
"testKey",
"a test targeting value"
],
[
"always_use_me",
"abc"
Expand Down