From 9e7e637f2d3badb3649983dbd167cf75d197bd7f Mon Sep 17 00:00:00 2001 From: Stanislav A Date: Fri, 18 Feb 2022 12:59:57 +0300 Subject: [PATCH] rename redirect --- src/helpers/compatibility-redirects.js | 2 +- .../{constant-detection-stubs.js => prebid-ads.js} | 10 +++++----- src/redirects/redirects-list.js | 2 +- tests/redirects/index.test.js | 2 +- ...tant-detection-stubs.test.js => prebid-ads.test.js} | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) rename src/redirects/{constant-detection-stubs.js => prebid-ads.js} (68%) rename tests/redirects/{constant-detection-stubs.test.js => prebid-ads.test.js} (75%) diff --git a/src/helpers/compatibility-redirects.js b/src/helpers/compatibility-redirects.js index e71851342..8d115346a 100644 --- a/src/helpers/compatibility-redirects.js +++ b/src/helpers/compatibility-redirects.js @@ -168,7 +168,7 @@ const redirects = [ adg: 'tagcommander-tc', }, { - adg: 'constant-detection-stubs', + adg: 'prebid-ads', ubo: 'prebid-ads.js', }, ]; diff --git a/src/redirects/constant-detection-stubs.js b/src/redirects/prebid-ads.js similarity index 68% rename from src/redirects/constant-detection-stubs.js rename to src/redirects/prebid-ads.js index f88c5fdfa..562b6acff 100644 --- a/src/redirects/constant-detection-stubs.js +++ b/src/redirects/prebid-ads.js @@ -2,7 +2,7 @@ import { hit } from '../helpers'; /** - * @redirect constant-detection-stubs + * @redirect prebid-ads * * @description * Sets predefined constants on a page. @@ -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]; diff --git a/src/redirects/redirects-list.js b/src/redirects/redirects-list.js index 0db7cc803..f9e45ec41 100644 --- a/src/redirects/redirects-list.js +++ b/src/redirects/redirects-list.js @@ -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'; diff --git a/tests/redirects/index.test.js b/tests/redirects/index.test.js index 7a656da7a..bdd371641 100644 --- a/tests/redirects/index.test.js +++ b/tests/redirects/index.test.js @@ -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'; diff --git a/tests/redirects/constant-detection-stubs.test.js b/tests/redirects/prebid-ads.test.js similarity index 75% rename from tests/redirects/constant-detection-stubs.test.js rename to tests/redirects/prebid-ads.test.js index 2253b744a..c60a9e03e 100644 --- a/tests/redirects/constant-detection-stubs.test.js +++ b/tests/redirects/prebid-ads.test.js @@ -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']; @@ -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'); });