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

Adapter bug fix #1096

Merged
merged 39 commits into from
Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c4367bc
Added WideOrbit adapter
bjorn-wo Feb 4, 2016
19ea04d
Merge branch 'master' of https://github.com/prebid/Prebid.js
bjorn-wo Feb 4, 2016
1dc879e
Fix User Matching code
bjorn-wo Feb 4, 2016
428ca07
update repo from prebid.js
bjorn-wo Feb 15, 2016
cd0b8ed
Renamed adapter + some minor JS issues
bjorn-wo Feb 15, 2016
6dc3198
Added flag for notifying front action is header bidding. Use returned…
bjorn-wo Feb 25, 2016
cf5e0cc
Merge remote-tracking branch 'upstream/master'
bjorn-wo Feb 25, 2016
4dbe270
Duplicated properties fixed.
bjorn-wo Feb 29, 2016
b21ef42
Correcting adaptermanager after wrong merge. Now all tests passes cor…
Mar 1, 2016
32289dc
Seting fl and jscb directly in the pageImpression-part of the url, si…
Mar 3, 2016
df7486e
Fixed above the fold parameter
bjorn-wo Mar 3, 2016
3f8a403
No need to modify original value.
Mar 3, 2016
4a0d1f7
Normalizing file regarding single or double quotes. Also, properly in…
Mar 3, 2016
82506d9
Removed uneeded properties: referrer (twice) and tagId.
Mar 3, 2016
82ef76a
Slightly better readiblity for variable declarations (and definition …
Mar 3, 2016
5e1d7ed
Refactoring regarding function naming and the way we set rank parameter.
Mar 4, 2016
646804c
Ignoring TypeScript's typing definitions.
Mar 4, 2016
bbd3ebb
Added initial WideOrbit Adapter tests covering url-creation part.
Mar 4, 2016
c6e876e
Completed wide orbit adapter tests with the one regarding callback re…
Mar 7, 2016
69a86e0
Slightly better test names.
Mar 7, 2016
35d52e6
Fix support for already prepared tracking pixels
bjorn-wo Apr 13, 2016
ac2b698
Merge remote-tracking branch 'upstream/master'
bjorn-wo Apr 27, 2016
4e3c0ea
Modified indenting according to coding standard
bjorn-wo Apr 27, 2016
a96ff78
Code review fixes
bjorn-wo May 10, 2016
f832b26
Marked required parameters
bjorn-wo May 11, 2016
584f4ab
Merge remote-tracking branch 'upstream/master'
bjorn-wo May 24, 2016
a93636a
Remove unused library from package.json
bjorn-wo May 24, 2016
f397076
Fix conflict with package.json
bjorn-wo May 26, 2016
d5e6a80
Merge remote-tracking branch 'upstream/master'
bjorn-wo Feb 2, 2017
c00bf75
Added support for referrer
bjorn-wo Feb 2, 2017
79dc0f1
Added support for referrer
bjorn-wo Feb 2, 2017
bb41f0f
Merge branch 'master' of https://github.com/WideOrbit/Prebid.js
bjorn-wo Feb 2, 2017
15b867f
Updated line endings to UNIX style
bjorn-wo Feb 23, 2017
74545b0
Fixed formatting issue
bjorn-wo Feb 23, 2017
feb789c
Fix user matching identification for JavaScript type
bjorn-wo Mar 2, 2017
b440566
Merge remote-tracking branch 'upstream/master'
bjorn-wo Mar 2, 2017
cfac6a7
Duplicated WideOrbit spec after merge
bjorn-wo Mar 2, 2017
b421e4b
Made adapter more robust for server misconfiguration
bjorn-wo Mar 30, 2017
c5b7abb
Merge remote-tracking branch 'upstream/master'
bjorn-wo Mar 30, 2017
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
7 changes: 5 additions & 2 deletions src/adapters/wideorbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ var WideOrbitAdapter = function WideOrbitAdapter() {
createdElem;

utils._each(userMatchings, function (userMatching) {
createdElem = undefined;
switch (userMatching.Type) {
case 'redirect':
createdElem = document.createElement('img');
Expand All @@ -146,8 +147,10 @@ var WideOrbitAdapter = function WideOrbitAdapter() {
createdElem.async = true;
break;
}
createdElem.src = decodeURIComponent(userMatching.Url);
headElem.insertBefore(createdElem, headElem.firstChild);
if (createdElem) {
createdElem.src = decodeURIComponent(userMatching.Url);
headElem.insertBefore(createdElem, headElem.firstChild);
}
});
}

Expand Down
19 changes: 19 additions & 0 deletions test/spec/adapters/wideorbit_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,25 @@ describe('wideorbit adapter tests', function () {
stubAddBidResponse.restore();
});

it('should do nothing when type is set to unrecognized type', function () {

var stubAddBidResponse = sinon.stub(bidmanager, 'addBidResponse');

var response = {
UserMatchings: [
{
Type: 'unrecognized',
Url: 'http%3A%2F%2Fwww.admeta.com%2F1.js'
}
],
Placements: placements
};

$$PREBID_GLOBAL$$.handleWideOrbitCallback(response);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you assert that addBidResponse wasn't invoked here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will actually call addBidResponse. It will however not throw an exception as it did before. I agree the test isn't very good, but it did catch my particular issue.

stubAddBidResponse.restore();
});

});

});