-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove old adloader#trackPixel (#1159)
- Loading branch information
Showing
2 changed files
with
0 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,4 @@ | ||
describe('adLoader', function () { | ||
var assert = require('chai').assert, | ||
adLoader = require('../../src/adloader'); | ||
|
||
describe('trackPixel', function () { | ||
it('correctly appends a cachebuster query paramter to a pixel with no existing parameters', function () { | ||
var inputUrl = 'http://www.example.com/tracking_pixel', | ||
token = '?rnd=', | ||
expectedPartialUrl = inputUrl + token, | ||
actual = adLoader.trackPixel(inputUrl), | ||
actualPartialUrl = actual.split(token)[0] + token, | ||
randomNumber = parseInt(actual.split(token)[1]); | ||
assert.strictEqual(actualPartialUrl, expectedPartialUrl); | ||
assert.isNumber(randomNumber); | ||
}); | ||
}); | ||
|
||
it('correctly appends a cachebuster query paramter to a pixel with one existing parameter', function () { | ||
var inputUrl = 'http://www.example.com/tracking_pixel?food=bard', | ||
token = '&rnd=', | ||
expectedPartialUrl = inputUrl + token, | ||
actual = adLoader.trackPixel(inputUrl), | ||
actualPartialUrl = actual.split(token)[0] + token, | ||
randomNumber = parseInt(actual.split(token)[1]); | ||
assert.strictEqual(actualPartialUrl, expectedPartialUrl); | ||
assert.isNumber(randomNumber); | ||
}); | ||
|
||
it('correctly appends a cachebuster query paramter to a pixel with multiple existing parameters', function () { | ||
var inputUrl = 'http://www.example.com/tracking_pixel?food=bard&zing=zang', | ||
token = '&rnd=', | ||
expectedPartialUrl = inputUrl + token, | ||
actual = adLoader.trackPixel(inputUrl), | ||
actualPartialUrl = actual.split(token)[0] + token, | ||
randomNumber = parseInt(actual.split(token)[1]); | ||
assert.strictEqual(actualPartialUrl, expectedPartialUrl); | ||
assert.isNumber(randomNumber); | ||
}); | ||
|
||
}); |