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

alter sonobi unit test to fix Edge test failure #2904

Merged
merged 2 commits into from
Jul 27, 2018
Merged
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
10 changes: 7 additions & 3 deletions test/spec/modules/sonobiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe('SonobiBidAdapter', () => {
'url': 'https://apex.go.sonobi.com/trinity.json',
'withCredentials': true,
'data': {
'key_maker': '{"30b31c1838de1f":"1a2b3c4d5e6f1a2b3c4d|300x250,300x600|f=1.25","/7780971/sparks_prebid_LB|30b31c1838de1e":"300x250,300x600"}', 'ref': 'http://localhost:9876/', 's': '2474372d-c0ff-4f46-aef4-a173058403d9', 'pv': 'c9cfc207-cd83-4a01-b591-8bb29389d4b0'
'key_maker': '{"30b31c1838de1f":"1a2b3c4d5e6f1a2b3c4d|300x250,300x600|f=1.25","/7780971/sparks_prebid_LB|30b31c1838de1e":"300x250,300x600"}', 'ref': 'http://localhost/', 's': '2474372d-c0ff-4f46-aef4-a173058403d9', 'pv': 'c9cfc207-cd83-4a01-b591-8bb29389d4b0'
},
'bidderRequests': [
{
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('SonobiBidAdapter', () => {
'cpm': 1.07,
'width': 300,
'height': 600,
'ad': '<script type="text/javascript" src="https://mco-1-apex.go.sonobi.com/sbi.js?aid=30292e432662bd5f86d90774b944b039&as=null&ref=http://localhost:9876/"></script>',
'ad': '<script type="text/javascript" src="https://mco-1-apex.go.sonobi.com/sbi.js?aid=30292e432662bd5f86d90774b944b039&as=null&ref=http://localhost/"></script>',
'ttl': 500,
'creativeId': '1234abcd',
'netRevenue': true,
Expand All @@ -306,7 +306,7 @@ describe('SonobiBidAdapter', () => {
'cpm': 1.25,
'width': 300,
'height': 250,
'ad': 'https://mco-1-apex.go.sonobi.com/vast.xml?vid=30292e432662bd5f86d90774b944b038&ref=http://localhost:9876/',
'ad': 'https://mco-1-apex.go.sonobi.com/vast.xml?vid=30292e432662bd5f86d90774b944b038&ref=http://localhost/',
'ttl': 500,
'creativeId': '30292e432662bd5f86d90774b944b038',
'netRevenue': true,
Expand All @@ -318,6 +318,10 @@ describe('SonobiBidAdapter', () => {

it('should map bidResponse to prebidResponse', () => {
const response = spec.interpretResponse(bidResponse, bidRequests);
response.forEach(resp => {
let regx = /http:\/\/localhost:9876\/.*?(?="|$)/
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure hardcoded the port is a good way to prevent this error. I'm not sure but some process is generating the port (karma?) and we should probably use whatever it is assigning or figure out another way to prevent this test case failure.

Copy link
Collaborator Author

@jsnellbaker jsnellbaker Jul 27, 2018

Choose a reason for hiding this comment

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

Like we discussed offline - I removed the port values from the unit tests. Please take another look when possible.

resp.ad = resp.ad.replace(regx, 'http://localhost/');
});
expect(response).to.deep.equal(prebidResponse);
})
})
Expand Down