Skip to content

Commit

Permalink
rename redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Feb 18, 2022
1 parent 6181870 commit 9e7e637
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/helpers/compatibility-redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const redirects = [
adg: 'tagcommander-tc',
},
{
adg: 'constant-detection-stubs',
adg: 'prebid-ads',
ubo: 'prebid-ads.js',
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { hit } from '../helpers';

/**
* @redirect constant-detection-stubs
* @redirect prebid-ads
*
* @description
* Sets predefined constants on a page.
Expand All @@ -15,17 +15,17 @@ import { hit } from '../helpers';
* ||gapt.hit.gemius.pl/gplayer.js$script,redirect=gemius
* ```
*/
export function constantDetectionStubs(source) {
export function prebidAds(source) {
window.canRunAds = true;
window.isAdBlockActive = false;

hit(source);
}

constantDetectionStubs.names = [
'constant-detection-stubs',
prebidAds.names = [
'prebid-ads',
'ubo-prebid-ads.js',
'prebid-ads.js',
];

constantDetectionStubs.injections = [hit];
prebidAds.injections = [hit];
2 changes: 1 addition & 1 deletion src/redirects/redirects-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export * from './google-ima3';
export * from './tagcommander-tc.js';
export * from './didomi-loader.js';
export * from './prebid.js';
export * from './constant-detection-stubs.js';
export * from './prebid-ads.js';
2 changes: 1 addition & 1 deletion tests/redirects/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import './prevent-bab2.test';
import './tagcommander-tc.test';
import './prebid.test';
import './didomi-loader.test';
import './constant-detection-stubs.test';
import './prebid-ads.test';
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { runRedirect, clearGlobalProps } from '../helpers';

const { test, module } = QUnit;
const name = 'constant-detection-stubs';
const name = 'prebid-ads';

const changingProps = ['hit', '__debug'];

Expand All @@ -21,8 +21,8 @@ module(name, { beforeEach, afterEach });
test('constants are set', (assert) => {
runRedirect(name);

assert.true(window.canRunAds, 'window.Piwik exists');
assert.false(window.isAdBlockActive, 'Piwik.getTracker exists');
assert.true(window.canRunAds, 'window.canRunAds created');
assert.false(window.isAdBlockActive, 'Piwik.isAdBlockActive created');

assert.strictEqual(window.hit, 'FIRED', 'hit function was executed');
});

0 comments on commit 9e7e637

Please sign in to comment.