From f66d1bde67ca9cd59bca78b8548ac770b0684278 Mon Sep 17 00:00:00 2001 From: Abban Dunne Date: Thu, 31 Oct 2024 09:58:58 +0100 Subject: [PATCH 1/2] Replace window timer with injected timer Components that use timers are hard to test. This removed the window timers and replaces them with an interface that we can mock. Updates all tests and banners to use the new timer. Ticket: https://phabricator.wikimedia.org/T378589 --- .../C24_WMDE_Desktop_DE_00/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_00/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_01/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_01/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_02/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_02/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_03/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_03/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_04/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_04/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_05/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_05/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_06/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_06/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_07/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_07/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_08/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_08/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_09/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_09/banner_var.ts | 2 + .../C24_WMDE_Desktop_DE_10/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_DE_10/banner_var.ts | 2 + .../C24_WMDE_Desktop_EN_00/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_EN_00/banner_var.ts | 2 + .../C24_WMDE_Desktop_EN_01/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_EN_01/banner_var.ts | 2 + .../C24_WMDE_Desktop_EN_02/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_EN_02/banner_var.ts | 2 + .../C24_WMDE_Desktop_EN_02b/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_EN_02b/banner_var.ts | 2 + .../C24_WMDE_Desktop_EN_03/banner_ctrl.ts | 2 + .../C24_WMDE_Desktop_EN_03/banner_var.ts | 2 + .../C24_WMDE_Mobile_DE_00/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_DE_00/banner_var.ts | 2 + .../C24_WMDE_Mobile_DE_01/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_DE_01/banner_var.ts | 2 + .../C24_WMDE_Mobile_DE_02/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_DE_02/banner_var.ts | 2 + .../C24_WMDE_Mobile_DE_03/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_DE_03/banner_var.ts | 2 + .../C24_WMDE_Mobile_DE_04/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_DE_04/banner_var.ts | 2 + .../C24_WMDE_Mobile_DE_05/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_DE_05/banner_var.ts | 2 + .../C24_WMDE_Mobile_DE_06/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_DE_06/banner_var.ts | 2 + .../C24_WMDE_Mobile_EN_00/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_EN_00/banner_var.ts | 2 + .../C24_WMDE_Mobile_EN_01/banner_ctrl.ts | 2 + .../C24_WMDE_Mobile_EN_01/banner_var.ts | 2 + banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts | 2 + banners/pad/C24_WMDE_iPad_00/banner_var.ts | 2 + .../pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts | 2 + banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts | 2 + banners/thank_you/banner_ctrl.de.ts | 2 + banners/thank_you/banner_ctrl.en.ts | 2 + banners/thank_you/banner_ctrl.wpde.ts | 2 + banners/thank_you/banner_var.de.ts | 2 + banners/thank_you/banner_var.en.ts | 2 + banners/thank_you/banner_var.wpde.ts | 2 + .../C24_WPDE_Desktop_00/banner_ctrl.ts | 2 + .../C24_WPDE_Desktop_00/banner_var.ts | 2 + .../C24_WPDE_Desktop_01/banner_ctrl.ts | 2 + .../C24_WPDE_Desktop_01/banner_var.ts | 2 + .../C24_WPDE_Mobile_00/banner_ctrl.ts | 2 + .../C24_WPDE_Mobile_00/banner_var.ts | 2 + .../C24_WPDE_Mobile_01/banner_ctrl.ts | 2 + .../C24_WPDE_Mobile_01/banner_var.ts | 2 + package-lock.json | 3 +- .../BannerConductor/BannerConductor.vue | 4 +- .../FallbackBannerConductor.vue | 4 +- .../StateMachine/states/ClosedState.ts | 12 +- .../StateMachine/states/NotShownState.ts | 13 ++- .../StateMachine/states/PendingState.ts | 11 +- .../StateMachine/states/ShowingState.ts | 11 +- .../StateMachine/states/StateFactory.ts | 25 ++-- .../DonationForm/MultiStepDonation.vue | 6 +- src/components/Footer/SelectionInput.vue | 6 +- src/components/Slider/KeenSlider.vue | 14 ++- src/components/SoftClose/SoftClose.vue | 14 +-- .../composables/useLiveDateAndTime.ts | 10 +- src/utils/Timer.ts | 56 +++++++++ .../components/BannerCtrl.spec.ts | 22 ++-- .../components/FallbackBanner.spec.ts | 15 +-- .../components/BannerCtrl.spec.ts | 20 ++-- .../components/BannerVar.spec.ts | 24 ++-- .../components/FallbackBanner.spec.ts | 15 +-- .../components/BannerCtrl.spec.ts | 24 ++-- .../components/BannerVar.spec.ts | 24 ++-- .../components/FallbackBanner.spec.ts | 15 +-- .../components/BannerCtrl.spec.ts | 24 ++-- .../components/BannerVar.spec.ts | 16 ++- .../components/FallbackBanner.spec.ts | 18 +-- .../components/BannerCtrl.spec.ts | 24 ++-- .../components/FallbackBanner.spec.ts | 18 +-- .../components/BannerCtrl.spec.ts | 24 ++-- .../components/BannerVar.spec.ts | 25 ++-- .../components/FallbackBanner.spec.ts | 18 +-- .../components/BannerCtrl.spec.ts | 20 ++-- .../components/BannerVar.spec.ts | 20 ++-- .../components/BannerCtrl.spec.ts | 20 ++-- .../components/BannerVar.spec.ts | 20 ++-- .../components/BannerCtrl.spec.ts | 14 +-- .../components/BannerVar.spec.ts | 14 +-- .../components/BannerCtrl.de.spec.ts | 4 +- .../components/BannerCtrl.en.spec.ts | 4 +- .../thank_you/components/BannerVar.de.spec.ts | 4 +- .../thank_you/components/BannerVar.en.spec.ts | 4 +- .../components/BannerCtrl.spec.ts | 25 ++-- .../components/BannerVar.spec.ts | 25 ++-- .../components/BannerCtrl.spec.ts | 16 +-- .../components/BannerVar.spec.ts | 16 +-- .../BannerConductor/BannerConductor.spec.ts | 4 +- .../FallbackBannerConductor.spec.ts | 4 +- .../StateMachine/states/ClosedState.spec.ts | 52 ++++++++- .../StateMachine/states/NotShownState.spec.ts | 64 +++++++++- .../StateMachine/states/PendingState.spec.ts | 23 ++-- .../StateMachine/states/ShowingState.spec.ts | 25 ++-- .../DonationForm/MultiStepDonation.spec.ts | 4 +- test/components/Footer/SelectionInput.spec.ts | 40 +++---- test/components/Slider/KeenSlider.spec.ts | 45 +++++--- test/components/SoftClose/SoftClose.spec.ts | 109 +++++++----------- test/features/BannerContent.ts | 42 +++---- test/features/FallbackBanner.ts | 17 ++- test/features/MiniBanner.ts | 4 +- test/features/SetCookieImage.ts | 41 +++++-- test/features/SetCookieImageMobile.ts | 23 +++- test/features/SoftCloseDesktop.ts | 49 ++++++-- test/features/SoftCloseMobile.ts | 45 ++++++-- test/fixtures/TimerSpy.ts | 47 ++++++++ test/fixtures/TimerStub.ts | 26 +++++ 131 files changed, 949 insertions(+), 572 deletions(-) create mode 100644 src/utils/Timer.ts create mode 100644 test/fixtures/TimerSpy.ts create mode 100644 test/fixtures/TimerStub.ts diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts index 7f9994936..0dfc062a4 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( date, page.getCampaignParameters() ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts index 85b153c1c..3567169ad 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( date, page.getCampaignParameters() ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts index eb35649e0..732e91cc5 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { ap: '0' } ) ); app.provide( 'tracker', tracker ); app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( date, page.getCampaignParameters() ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts index 3a418c246..45f0d1776 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { ap: '1' } ) ); app.provide( 'tracker', tracker ); app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( date, page.getCampaignParameters() ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts index 7f9994936..0dfc062a4 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( date, page.getCampaignParameters() ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts index 6199fee8c..f1429c40a 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmo app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); app.provide( 'currentCampaignTimePercentage', currentCampaignTimePercentage( date, page.getCampaignParameters() ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts index 4852c479f..bda6ddc01 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts index 72d09db1a..a979c6fea 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts index c001ca341..dd81a0301 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts index 38d8fd57c..b298041c4 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts index facc42cd2..484d71792 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts index 2865e59dc..0c599541c 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts index facc42cd2..484d71792 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts index 45d16db95..ee992cc6a 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { createFAQPageURL } from '@src/createFAQPageURL'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts index facc42cd2..484d71792 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts index bb733ecca..0b02e0d9d 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -70,5 +71,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts index 51ffcb4de..2be3e1dd8 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts index 9a4e915cc..f1f6d755c 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts index 51ffcb4de..2be3e1dd8 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts index ac98bbf3c..85fc66680 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts index 51ffcb4de..2be3e1dd8 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts index 2ebfc85e4..784a4c1be 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts @@ -27,6 +27,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items_var'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const date = new Date(); const localeFactory = new LocaleFactoryDe(); @@ -72,5 +73,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts index 03fdd1d4e..356e51c58 100644 --- a/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts index 5bd8d91e5..72b570412 100644 --- a/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts index d858b2b45..07b0436c4 100644 --- a/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts index 982f09e7f..f56ac5fae 100644 --- a/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, ap: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts index d858b2b45..07b0436c4 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts index 99df90506..fa370094b 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts index d858b2b45..07b0436c4 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts index 99df90506..fa370094b 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts index 8b6c29b69..dc7dc1995 100644 --- a/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, afo: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts index c44fad8ee..61395bfb6 100644 --- a/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts @@ -27,6 +27,7 @@ import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map_var'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -69,5 +70,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN, afo: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts index afa1c1148..df6ec60fb 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts index c4a1efb85..da38ca6d8 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items_var'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts index afa1c1148..df6ec60fb 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts index a316249ea..52609ee9b 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts index afa1c1148..df6ec60fb 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts index 83c912876..0f99acfa9 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { ap: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts index afa1c1148..df6ec60fb 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts index 90adf82dc..183230fea 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts index 885f8980c..4fcea4f91 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts index be124864d..2248b371f 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts index 885f8980c..4fcea4f91 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts index e5dd7a8f0..7f3cc6c61 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts @@ -25,6 +25,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; // Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts index 8c0342a68..01de2c240 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -67,5 +68,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts index db17c8383..ef4976725 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts @@ -26,6 +26,7 @@ import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -67,5 +68,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { afo: '1', ap: '0' } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts index 416e5f204..05554ca7a 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts @@ -26,6 +26,7 @@ import { createFormActions } from '@src/createFormActions'; // Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts index 0272d42c0..42da644e5 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts @@ -26,6 +26,7 @@ import { createFormActions } from '@src/createFormActions'; // Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts index 416e5f204..05554ca7a 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts @@ -26,6 +26,7 @@ import { createFormActions } from '@src/createFormActions'; // Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts index 51cf7c779..aef6ea997 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts @@ -26,6 +26,7 @@ import { createFormActions } from '@src/createFormActions'; // Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryEn(); const translator = new Translator( messages ); @@ -65,5 +66,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount, { locale: Locales.EN } ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts b/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts index ad852f9d2..e81d1b159 100644 --- a/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts +++ b/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts @@ -24,6 +24,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -63,5 +64,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/pad/C24_WMDE_iPad_00/banner_var.ts b/banners/pad/C24_WMDE_iPad_00/banner_var.ts index 168bfa015..df58c9b8b 100644 --- a/banners/pad/C24_WMDE_iPad_00/banner_var.ts +++ b/banners/pad/C24_WMDE_iPad_00/banner_var.ts @@ -24,6 +24,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -63,5 +64,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts b/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts index ad852f9d2..e81d1b159 100644 --- a/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts +++ b/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts @@ -24,6 +24,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -63,5 +64,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts b/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts index 4fe47bc10..038458957 100644 --- a/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts +++ b/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts @@ -24,6 +24,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryDe(); const translator = new Translator( messages ); @@ -63,5 +64,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/thank_you/banner_ctrl.de.ts b/banners/thank_you/banner_ctrl.de.ts index b22eda076..ca8149119 100644 --- a/banners/thank_you/banner_ctrl.de.ts +++ b/banners/thank_you/banner_ctrl.de.ts @@ -21,6 +21,7 @@ import { createTrackedURL, SUBSCRIBE_URL, USE_OF_FUNDS_URL } from './createTrack import { createThankYouSettings } from './settings'; import { IntegerDe } from '@src/utils/DynamicContent/formatters/IntegerDe'; import { Locales } from '@src/domain/Locales'; +import { WindowTimer } from '@src/utils/Timer'; const translator = new Translator( messages ); const mediaWiki = new WindowMediaWiki(); @@ -48,5 +49,6 @@ const app = createVueApp( BannerConductor, { app.use( TranslationPlugin, translator ); app.provide( 'tracker', tracker ); app.provide( 'formActions', new TrackingMembershipFormActions( page.getTracking(), impressionCount, Locales.DE ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/thank_you/banner_ctrl.en.ts b/banners/thank_you/banner_ctrl.en.ts index 33f0f4f52..8977aceb7 100644 --- a/banners/thank_you/banner_ctrl.en.ts +++ b/banners/thank_you/banner_ctrl.en.ts @@ -21,6 +21,7 @@ import { createTrackedURL, SUBSCRIBE_URL, USE_OF_FUNDS_URL } from './createTrack import { createThankYouSettings } from './settings'; import { IntegerEn } from '@src/utils/DynamicContent/formatters/IntegerEn'; import { Locales } from '@src/domain/Locales'; +import { WindowTimer } from '@src/utils/Timer'; const translator = new Translator( messages ); const mediaWiki = new WindowMediaWiki(); @@ -48,5 +49,6 @@ const app = createVueApp( BannerConductor, { app.use( TranslationPlugin, translator ); app.provide( 'tracker', tracker ); app.provide( 'formActions', new TrackingMembershipFormActions( page.getTracking(), impressionCount, Locales.EN ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/thank_you/banner_ctrl.wpde.ts b/banners/thank_you/banner_ctrl.wpde.ts index 3cadfb5f9..98a8a2b8b 100644 --- a/banners/thank_you/banner_ctrl.wpde.ts +++ b/banners/thank_you/banner_ctrl.wpde.ts @@ -17,6 +17,7 @@ import eventMap from './event_map.wpde'; import { createThankYouSettings } from './settings'; import { IntegerDe } from '@src/utils/DynamicContent/formatters/IntegerDe'; import { Locales } from '@src/domain/Locales'; +import { WindowTimer } from '@src/utils/Timer'; // Tracking placeholders will be replaced by webpack string-replace-loader // using the campaign configuration ( campaign_info.toml ) for the correct values @@ -50,5 +51,6 @@ const app = createVueApp( BannerConductor, { app.use( TranslationPlugin, translator ); app.provide( 'tracker', tracker ); app.provide( 'formActions', new TrackingMembershipFormActions( page.getTracking(), impressionCount, Locales.DE ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/thank_you/banner_var.de.ts b/banners/thank_you/banner_var.de.ts index d88ea7353..916c28b8a 100644 --- a/banners/thank_you/banner_var.de.ts +++ b/banners/thank_you/banner_var.de.ts @@ -21,6 +21,7 @@ import { createTrackedURL, SUBSCRIBE_URL, USE_OF_FUNDS_URL } from './createTrack import { createThankYouSettings } from './settings'; import { IntegerDe } from '@src/utils/DynamicContent/formatters/IntegerDe'; import { Locales } from '@src/domain/Locales'; +import { WindowTimer } from '@src/utils/Timer'; const translator = new Translator( messages ); const mediaWiki = new WindowMediaWiki(); @@ -48,5 +49,6 @@ const app = createVueApp( BannerConductor, { app.use( TranslationPlugin, translator ); app.provide( 'tracker', tracker ); app.provide( 'formActions', new TrackingMembershipFormActions( page.getTracking(), impressionCount, Locales.DE ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/thank_you/banner_var.en.ts b/banners/thank_you/banner_var.en.ts index 4be822d1b..5d8453104 100644 --- a/banners/thank_you/banner_var.en.ts +++ b/banners/thank_you/banner_var.en.ts @@ -21,6 +21,7 @@ import { createTrackedURL, SUBSCRIBE_URL, USE_OF_FUNDS_URL } from './createTrack import { createThankYouSettings } from './settings'; import { IntegerEn } from '@src/utils/DynamicContent/formatters/IntegerEn'; import { Locales } from '@src/domain/Locales'; +import { WindowTimer } from '@src/utils/Timer'; const translator = new Translator( messages ); const mediaWiki = new WindowMediaWiki(); @@ -48,5 +49,6 @@ const app = createVueApp( BannerConductor, { app.use( TranslationPlugin, translator ); app.provide( 'tracker', tracker ); app.provide( 'formActions', new TrackingMembershipFormActions( page.getTracking(), impressionCount, Locales.EN ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/thank_you/banner_var.wpde.ts b/banners/thank_you/banner_var.wpde.ts index 7cee772c2..cacfcd560 100644 --- a/banners/thank_you/banner_var.wpde.ts +++ b/banners/thank_you/banner_var.wpde.ts @@ -17,6 +17,7 @@ import eventMap from './event_map.wpde'; import { createThankYouSettings } from './settings'; import { IntegerDe } from '@src/utils/DynamicContent/formatters/IntegerDe'; import { Locales } from '@src/domain/Locales'; +import { WindowTimer } from '@src/utils/Timer'; // Tracking placeholders will be replaced by webpack string-replace-loader // using the campaign configuration ( campaign_info.toml ) for the correct values @@ -50,5 +51,6 @@ const app = createVueApp( BannerConductor, { app.use( TranslationPlugin, translator ); app.provide( 'tracker', tracker ); app.provide( 'formActions', new TrackingMembershipFormActions( page.getTracking(), impressionCount, Locales.DE ) ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts index 98d284d8d..e91454f4d 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts @@ -21,6 +21,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -67,5 +68,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts index bd3870274..03a022150 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts @@ -21,6 +21,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -67,5 +68,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts index 98d284d8d..e91454f4d 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts @@ -21,6 +21,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -67,5 +68,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts index bd3870274..03a022150 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts @@ -21,6 +21,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -67,5 +68,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts index 3315f7c59..80721fb97 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts @@ -22,6 +22,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -68,5 +69,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts index 3811316ce..18ab49b42 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts @@ -22,6 +22,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -68,5 +69,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts index 3315f7c59..80721fb97 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts @@ -22,6 +22,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -68,5 +69,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts index 3811316ce..18ab49b42 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts @@ -22,6 +22,7 @@ import { createFormActions } from '@src/createFormActions'; // Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; +import { WindowTimer } from '@src/utils/Timer'; const localeFactory = new LocaleFactoryWpDe(); const translator = new Translator( messages ); @@ -68,5 +69,6 @@ app.provide( 'currencyFormatter', currencyFormatter ); app.provide( 'formItems', createFormItems( translator, currencyFormatter.euroAmount.bind( currencyFormatter ) ) ); app.provide( 'formActions', createFormActions( page.getTracking(), impressionCount ) ); app.provide( 'tracker', tracker ); +app.provide( 'timer', new WindowTimer() ); app.mount( page.getBannerContainer() ); diff --git a/package-lock.json b/package-lock.json index 4772cfbad..6f0bbfaba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6637,7 +6637,8 @@ }, "node_modules/fundraising-frontend-content": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/wmde/fundraising-frontend-content.git#7885b65b3892c6e32ec94548a2f901e7323fe439" + "resolved": "git+ssh://git@github.com/wmde/fundraising-frontend-content.git#a15a417b75aba9b485df180e537047b4b47f065a", + "license": "CC0-1.0" }, "node_modules/get-intrinsic": { "version": "1.2.4", diff --git a/src/components/BannerConductor/BannerConductor.vue b/src/components/BannerConductor/BannerConductor.vue index 134eabcf9..db3c1d4e7 100644 --- a/src/components/BannerConductor/BannerConductor.vue +++ b/src/components/BannerConductor/BannerConductor.vue @@ -31,6 +31,7 @@ import { Tracker } from '@src/tracking/Tracker'; import { TrackingEvent } from '@src/tracking/TrackingEvent'; import { CloseEvent } from '@src/tracking/events/CloseEvent'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; +import { Timer } from '@src/utils/Timer'; interface Props { page: Page, @@ -45,9 +46,10 @@ const props = withDefaults( defineProps(), { bannerProps: (): any => {} } ); const tracker = inject( 'tracker' ); +const timer = inject( 'timer' ); const bannerRef = ref( null ); -const stateFactory = newStateFactory( props.bannerConfig, props.page, tracker, props.resizeHandler, props.impressionCount ); +const stateFactory = newStateFactory( props.bannerConfig, props.page, tracker, props.resizeHandler, props.impressionCount, timer ); const bannerState = ref( stateFactory.newInitialState() ); const stateMachine = newBannerStateMachine( bannerState ); diff --git a/src/components/BannerConductor/FallbackBannerConductor.vue b/src/components/BannerConductor/FallbackBannerConductor.vue index dc7955afc..40c01721d 100644 --- a/src/components/BannerConductor/FallbackBannerConductor.vue +++ b/src/components/BannerConductor/FallbackBannerConductor.vue @@ -32,6 +32,7 @@ import { TrackingEvent, TrackingFeatureName } from '@src/tracking/TrackingEvent' import { CloseEvent } from '@src/tracking/events/CloseEvent'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; import { BannerNotShownReasons } from '@src/page/BannerNotShownReasons'; +import { Timer } from '@src/utils/Timer'; interface Props { page: Page, @@ -48,10 +49,11 @@ const props = withDefaults( defineProps(), { bannerProps: (): any => {} } ); const tracker = inject( 'tracker' ); +const timer = inject( 'timer' ); const banner = shallowRef( props.banner ); const bannerRef = ref( null ); -const stateFactory = newStateFactory( props.bannerConfig, props.page, tracker, props.resizeHandler, props.impressionCount ); +const stateFactory = newStateFactory( props.bannerConfig, props.page, tracker, props.resizeHandler, props.impressionCount, timer ); const bannerState = ref( stateFactory.newInitialState() ); const stateMachine = newBannerStateMachine( bannerState ); diff --git a/src/components/BannerConductor/StateMachine/states/ClosedState.ts b/src/components/BannerConductor/StateMachine/states/ClosedState.ts index cc4e07a06..0508bbdbf 100644 --- a/src/components/BannerConductor/StateMachine/states/ClosedState.ts +++ b/src/components/BannerConductor/StateMachine/states/ClosedState.ts @@ -4,6 +4,7 @@ import { Page } from '@src/page/Page'; import { Tracker } from '@src/tracking/Tracker'; import { ResizeHandler } from '@src/utils/ResizeHandler'; import { TrackingEvent } from '@src/tracking/TrackingEvent'; +import { Timer } from '@src/utils/Timer'; export class ClosedState extends BannerState { public readonly stateName: BannerStates = BannerStates.Closed; @@ -11,13 +12,21 @@ export class ClosedState extends BannerState { private _page: Page; private _tracker: Tracker; private _resizeHandler: ResizeHandler; + private _timer: Timer; - public constructor( closeEvent: TrackingEvent, page: Page, tracker: Tracker, resizeHandler: ResizeHandler ) { + public constructor( + closeEvent: TrackingEvent, + page: Page, + tracker: Tracker, + resizeHandler: ResizeHandler, + timer: Timer + ) { super(); this._closeEvent = closeEvent; this._page = page; this._tracker = tracker; this._resizeHandler = resizeHandler; + this._timer = timer; } public enter(): Promise { @@ -28,6 +37,7 @@ export class ClosedState extends BannerState { .setCloseCookieIfNecessary( this._closeEvent ) .removePageEventListeners(); this._resizeHandler.onClose(); + this._timer.clearAll(); return Promise.resolve(); } diff --git a/src/components/BannerConductor/StateMachine/states/NotShownState.ts b/src/components/BannerConductor/StateMachine/states/NotShownState.ts index 1f08db214..720a873d8 100644 --- a/src/components/BannerConductor/StateMachine/states/NotShownState.ts +++ b/src/components/BannerConductor/StateMachine/states/NotShownState.ts @@ -5,6 +5,7 @@ import { Page } from '@src/page/Page'; import { Tracker } from '@src/tracking/Tracker'; import { NotShownEvent } from '@src/tracking/events/NotShownEvent'; import { ResizeHandler } from '@src/utils/ResizeHandler'; +import { Timer } from '@src/utils/Timer'; export class NotShownState extends BannerState { public readonly stateName: BannerStates = BannerStates.NotShown; @@ -13,14 +14,23 @@ export class NotShownState extends BannerState { private _tracker: Tracker; private _resizeHandler: ResizeHandler; private _bannerHeight: number; + private _timer: Timer; - public constructor( bannerNotShownReason: BannerNotShownReasons, page: Page, tracker: Tracker, resizeHandler: ResizeHandler, bannerHeight: number ) { + public constructor( + bannerNotShownReason: BannerNotShownReasons, + page: Page, + tracker: Tracker, + resizeHandler: ResizeHandler, + bannerHeight: number, + timer: Timer + ) { super(); this._bannerNotShownReason = bannerNotShownReason; this._page = page; this._tracker = tracker; this._resizeHandler = resizeHandler; this._bannerHeight = bannerHeight; + this._timer = timer; } public enter(): Promise { @@ -34,6 +44,7 @@ export class NotShownState extends BannerState { .preventImpressionCountForHiddenBanner() .removePageEventListeners(); this._resizeHandler.onClose(); + this._timer.clearAll(); return Promise.resolve( true ); } diff --git a/src/components/BannerConductor/StateMachine/states/PendingState.ts b/src/components/BannerConductor/StateMachine/states/PendingState.ts index cfe1df51c..6df085fd5 100644 --- a/src/components/BannerConductor/StateMachine/states/PendingState.ts +++ b/src/components/BannerConductor/StateMachine/states/PendingState.ts @@ -1,20 +1,23 @@ import { BannerState } from '@src/components/BannerConductor/StateMachine/states/BannerState'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; import { Page } from '@src/page/Page'; +import { Timer } from '@src/utils/Timer'; export class PendingState extends BannerState { public readonly stateName: BannerStates = BannerStates.Pending; - private _timer: ReturnType; + private _timer: Timer; + private _timerId: number; private _page: Page; private readonly _bannerHeight: number; private readonly _delay: number; - public constructor( page: Page, bannerHeight: number, delay: number ) { + public constructor( page: Page, bannerHeight: number, delay: number, timer: Timer ) { super(); this._page = page; this._bannerHeight = bannerHeight; this._delay = delay; + this._timer = timer; this.canMoveToStates.push( BannerStates.Showing ); this.canMoveToStates.push( BannerStates.Closed ); @@ -25,12 +28,12 @@ export class PendingState extends BannerState { this._page.setSpace( this._bannerHeight ); return new Promise( ( resolve ) => { - this._timer = setTimeout( () => resolve( true ), this._delay ); + this._timerId = this._timer.setTimeout( () => resolve( true ), this._delay ); } ); } public exit(): Promise { - clearTimeout( this._timer ); + this._timer.clearTimeout( this._timerId ); return Promise.resolve(); } diff --git a/src/components/BannerConductor/StateMachine/states/ShowingState.ts b/src/components/BannerConductor/StateMachine/states/ShowingState.ts index 2cb4a85df..5f1915f4f 100644 --- a/src/components/BannerConductor/StateMachine/states/ShowingState.ts +++ b/src/components/BannerConductor/StateMachine/states/ShowingState.ts @@ -1,17 +1,20 @@ import { BannerState } from '@src/components/BannerConductor/StateMachine/states/BannerState'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; import { Page } from '@src/page/Page'; +import { Timer } from '@src/utils/Timer'; export class ShowingState extends BannerState { public readonly stateName: BannerStates = BannerStates.Showing; - private _timer: ReturnType; + private _timer: Timer; + private _timerId: number; private _page: Page; private readonly _transitionDuration: number; - public constructor( page: Page, transitionDuration: number ) { + public constructor( page: Page, transitionDuration: number, timer: Timer ) { super(); this._page = page; this._transitionDuration = transitionDuration; + this._timer = timer; this.canMoveToStates.push( BannerStates.Visible ); this.canMoveToStates.push( BannerStates.Closed ); @@ -23,12 +26,12 @@ export class ShowingState extends BannerState { .showBanner(); return new Promise( ( resolve ) => { - this._timer = setTimeout( () => resolve( true ), this._transitionDuration ); + this._timerId = this._timer.setTimeout( () => resolve( true ), this._transitionDuration ); } ); } public exit(): Promise { - clearTimeout( this._timer ); + this._timer.clearTimeout( this._timerId ); return Promise.resolve(); } diff --git a/src/components/BannerConductor/StateMachine/states/StateFactory.ts b/src/components/BannerConductor/StateMachine/states/StateFactory.ts index 3da8cfa48..faeeca5b1 100644 --- a/src/components/BannerConductor/StateMachine/states/StateFactory.ts +++ b/src/components/BannerConductor/StateMachine/states/StateFactory.ts @@ -12,6 +12,7 @@ import { ImpressionCount } from '@src/utils/ImpressionCount'; import { ClosedState } from '@src/components/BannerConductor/StateMachine/states/ClosedState'; import { InitialState } from '@src/components/BannerConductor/StateMachine/states/InitialState'; import { TrackingEvent, TrackingFeatureName } from '@src/tracking/TrackingEvent'; +import { Timer } from '@src/utils/Timer'; export class StateFactory { private readonly _bannerConfig: BannerConfig; @@ -19,13 +20,15 @@ export class StateFactory { private readonly _tracker: Tracker; private readonly _resizeHandler: ResizeHandler; private readonly _impressionCount: ImpressionCount; + private readonly _timer: Timer; - public constructor( bannerConfig: BannerConfig, page: Page, tracker: Tracker, resizeHandler: ResizeHandler, impressionCount: ImpressionCount ) { + public constructor( bannerConfig: BannerConfig, page: Page, tracker: Tracker, resizeHandler: ResizeHandler, impressionCount: ImpressionCount, timer: Timer ) { this._bannerConfig = bannerConfig; this._page = page; this._tracker = tracker; this._resizeHandler = resizeHandler; this._impressionCount = impressionCount; + this._timer = timer; } public newInitialState(): BannerState { @@ -33,15 +36,15 @@ export class StateFactory { } public newPendingState( bannerHeight: number ): BannerState { - return new PendingState( this._page, bannerHeight, this._bannerConfig.delay ); + return new PendingState( this._page, bannerHeight, this._bannerConfig.delay, this._timer ); } public newNotShownState( bannerNotShownReason: BannerNotShownReasons, bannerHeight: number ): BannerState { - return new NotShownState( bannerNotShownReason, this._page, this._tracker, this._resizeHandler, bannerHeight ); + return new NotShownState( bannerNotShownReason, this._page, this._tracker, this._resizeHandler, bannerHeight, this._timer ); } public newShowingState(): BannerState { - return new ShowingState( this._page, this._bannerConfig.transitionDuration ); + return new ShowingState( this._page, this._bannerConfig.transitionDuration, this._timer ); } public newVisibleState( shownEventFeature: TrackingFeatureName ): BannerState { @@ -49,16 +52,24 @@ export class StateFactory { } public newClosedState( closeEvent: TrackingEvent ): BannerState { - return new ClosedState( closeEvent, this._page, this._tracker, this._resizeHandler ); + return new ClosedState( closeEvent, this._page, this._tracker, this._resizeHandler, this._timer ); } } -export function newStateFactory( bannerConfig: BannerConfig, page: Page, tracker: Tracker, resizeHandler: ResizeHandler, impressionCount: ImpressionCount ): StateFactory { +export function newStateFactory( + bannerConfig: BannerConfig, + page: Page, + tracker: Tracker, + resizeHandler: ResizeHandler, + impressionCount: ImpressionCount, + timer: Timer +): StateFactory { return new StateFactory( bannerConfig, page, tracker, resizeHandler, - impressionCount + impressionCount, + timer ); } diff --git a/src/components/DonationForm/MultiStepDonation.vue b/src/components/DonationForm/MultiStepDonation.vue index f6ddfe18f..8aad4f0ad 100644 --- a/src/components/DonationForm/MultiStepDonation.vue +++ b/src/components/DonationForm/MultiStepDonation.vue @@ -27,6 +27,7 @@ import { Tracker } from '@src/tracking/Tracker'; import { TrackingEvent } from '@src/tracking/TrackingEvent'; import { useFormAction } from '@src/components/composables/useFormAction'; import { FormActions } from '@src/domain/FormActions'; +import { Timer } from '@src/utils/Timer'; interface Props { showErrorScrollLink?: boolean; @@ -51,6 +52,7 @@ usedSlotNames.forEach( ( slotName: string, index: number ): void => { slotNameIndices[ slotName ] = index; } ); const tracker = inject( 'tracker' ); +const timer = inject( 'timer' ); const currentStepIndex = ref( 0 ); const defaultFormAction = useFormAction( inject( 'formActions' ) ); const formAction = computed( (): string => { @@ -70,7 +72,7 @@ const [ container, slider ] = useKeenSlider( { function onClick(): void { // This is so the banner height is adjusted correctly if form errors change it when they appear // We wait using setTimeout as nextTick() doesn't work here for some reason - setTimeout( () => { + timer.nextTick( () => { emit( 'formInteraction' ); } ); } @@ -100,7 +102,7 @@ const onPrevious = async (): Promise => { onMounted( () => { // This fixes Keen Slider rendering a little early and not having the correct width - setTimeout( () => slider.value.update() ); + timer.nextTick( () => slider.value.update() ); } ); diff --git a/src/components/Footer/SelectionInput.vue b/src/components/Footer/SelectionInput.vue index 02b7940f7..39e773c5f 100644 --- a/src/components/Footer/SelectionInput.vue +++ b/src/components/Footer/SelectionInput.vue @@ -16,7 +16,8 @@ diff --git a/src/components/composables/useLiveDateAndTime.ts b/src/components/composables/useLiveDateAndTime.ts index 5646381ac..42fba116a 100644 --- a/src/components/composables/useLiveDateAndTime.ts +++ b/src/components/composables/useLiveDateAndTime.ts @@ -1,5 +1,6 @@ -import { ref, Ref } from 'vue'; +import { inject, ref, Ref } from 'vue'; import { DateAndTime } from '@src/utils/DynamicContent/DateAndTime'; +import { Timer } from '@src/utils/Timer'; type ReturnType = { liveDateAndTime: Ref; @@ -8,17 +9,18 @@ type ReturnType = { } export function useLiveDateAndTime( getCurrentDateAndTime: () => DateAndTime ): ReturnType { - const timer = ref( 0 ); + const timer = inject( 'timer' ); + const timerId = ref( 0 ); const liveDateAndTime = ref( getCurrentDateAndTime() ); const startTimer = (): void => { - timer.value = window.setInterval( () => { + timerId.value = timer.setInterval( () => { liveDateAndTime.value = getCurrentDateAndTime(); }, 1000 ); }; const stopTimer = (): void => { - window.clearInterval( timer.value ); + timer.clearInterval( timerId.value ); }; return { diff --git a/src/utils/Timer.ts b/src/utils/Timer.ts new file mode 100644 index 000000000..9b1ed85aa --- /dev/null +++ b/src/utils/Timer.ts @@ -0,0 +1,56 @@ +export interface Timer { + setTimeout( fn: () => void, after: number ): number; + clearTimeout( id: number ): void; + setInterval( fn: () => void, after: number ): number; + clearInterval( id: number ): void; + clearAll(): void; + nextTick( fn: () => void ): void; +} + +export class WindowTimer implements Timer { + private _intervals: number[] = []; + private _timers: number[] = []; + + public setInterval( fn: () => void, after: number ): number { + const interval = window.setInterval( fn, after ); + this._intervals.push( interval ); + return interval; + } + + public setTimeout( fn: () => void, after: number ): number { + const timer = window.setTimeout( fn, after ); + this._timers.push( timer ); + return timer; + } + + public clearAll(): void { + this._intervals.forEach( id => window.clearInterval( id ) ); + this._timers.forEach( id => window.clearTimeout( id ) ); + this._intervals = []; + this._timers = []; + } + + public clearInterval( id: number ): void { + const index = this._intervals.indexOf( id ); + if ( index === -1 ) { + return; + } + + window.clearInterval( id ); + this._intervals.splice( index, 1 ); + } + + public clearTimeout( id: number ): void { + const index = this._timers.indexOf( id ); + if ( index === -1 ) { + return; + } + + window.clearTimeout( id ); + this._timers.splice( index, 1 ); + } + + public nextTick( fn: () => void ): void { + window.setTimeout( fn ); + } +} diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/BannerCtrl.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/BannerCtrl.spec.ts index b00029cd9..dfc949f58 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/BannerCtrl.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/desktop/C24_WMDE_Desktop_DE_06/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,18 +8,15 @@ import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; import { resetFormModel } from '@test/resetFormModel'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { bannerMainFeatures } from '@test/features/MainBanner'; import { formActionSwitchFeatures } from '@test/features/form_action_switch/MainDonation_UpgradeToYearlyButton'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -28,15 +25,9 @@ describe( 'BannerCtrl.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -58,7 +49,8 @@ describe( 'BannerCtrl.vue', () => { }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/FallbackBanner.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/FallbackBanner.spec.ts index ea8a889a0..d5c0154be 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/FallbackBanner.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_06/components/FallbackBanner.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import FallbackBanner from '@banners/desktop/C24_WMDE_Desktop_DE_06/components/FallbackBanner.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,19 +8,11 @@ import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { Tracker } from '@src/tracking/Tracker'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { fallbackBannerFeatures, submitFeatures } from '@test/features/FallbackBanner'; +import { TimerStub } from '@test/fixtures/TimerStub'; const translator = ( key: string ): string => key; describe( 'FallbackBanner.vue', () => { - - beforeEach( () => { - vi.useFakeTimers(); - } ); - - afterEach( () => { - vi.useRealTimers(); - } ); - const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null ): VueWrapper => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: width } ); return mount( FallbackBanner, { @@ -36,7 +28,8 @@ describe( 'FallbackBanner.vue', () => { provide: { translator: { translate: translator }, dynamicCampaignText: dynamicContent ?? newDynamicContent(), - tracker: tracker ?? new TrackerStub() + tracker: tracker ?? new TrackerStub(), + timer: new TimerStub() } } } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerCtrl.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerCtrl.spec.ts index 525f886a3..d4f3ed930 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerCtrl.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test, vi } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,7 +8,8 @@ import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; import { - bannerContentAnimatedTextFeatures, bannerContentAverageDonationFeatures, + bannerContentAnimatedTextFeatures, + bannerContentAverageDonationFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures @@ -23,6 +24,8 @@ import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseSubmitTrackingFeaturesDesktop } from '@test/features/SoftCloseSubmitTrackingDesktop'; import { Tracker } from '@src/tracking/Tracker'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -32,18 +35,12 @@ describe( 'BannerCtrl.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); tracker = { trackEvent: vi.fn() }; } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -69,7 +66,8 @@ describe( 'BannerCtrl.vue', () => { }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -145,7 +143,7 @@ describe( 'BannerCtrl.vue', () => { test.each( [ [ 'expectDoesNotShowSoftClose' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerVar.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerVar.spec.ts index 5698ea7cb..28a4dd84a 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerVar.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerVar.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test, vi } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/desktop/C24_WMDE_Desktop_DE_08/components/BannerVar.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; import { resetFormModel } from '@test/resetFormModel'; @@ -23,6 +18,8 @@ import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseSubmitTrackingFeaturesDesktop } from '@test/features/SoftCloseSubmitTrackingDesktop'; import { Tracker } from '@src/tracking/Tracker'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -32,18 +29,12 @@ describe( 'BannerVar.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); tracker = { trackEvent: vi.fn() }; } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -69,7 +60,8 @@ describe( 'BannerVar.vue', () => { }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -144,7 +136,7 @@ describe( 'BannerVar.vue', () => { [ 'expectShowsCloseIcon' ], [ 'expectCloseIconEmitsCloseEvent' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/FallbackBanner.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/FallbackBanner.spec.ts index f7da37756..b68d62bb6 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/FallbackBanner.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_08/components/FallbackBanner.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import FallbackBanner from '@banners/desktop/C24_WMDE_Desktop_DE_08/components/FallbackBanner.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,19 +8,11 @@ import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { Tracker } from '@src/tracking/Tracker'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { fallbackBannerFeatures, submitFeatures } from '@test/features/FallbackBanner'; +import { TimerStub } from '@test/fixtures/TimerStub'; const translator = ( key: string ): string => key; describe( 'FallbackBanner.vue', () => { - - beforeEach( () => { - vi.useFakeTimers(); - } ); - - afterEach( () => { - vi.useRealTimers(); - } ); - const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null ): VueWrapper => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: width } ); return mount( FallbackBanner, { @@ -36,7 +28,8 @@ describe( 'FallbackBanner.vue', () => { provide: { translator: { translate: translator }, dynamicCampaignText: dynamicContent ?? newDynamicContent(), - tracker: tracker ?? new TrackerStub() + tracker: tracker ?? new TrackerStub(), + timer: new TimerStub() } } } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerCtrl.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerCtrl.spec.ts index 96fa200c9..2076a4a33 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerCtrl.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test, vi } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; import { resetFormModel } from '@test/resetFormModel'; @@ -23,6 +18,8 @@ import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseSubmitTrackingFeaturesDesktop } from '@test/features/SoftCloseSubmitTrackingDesktop'; import { Tracker } from '@src/tracking/Tracker'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -32,18 +29,12 @@ describe( 'BannerVar.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); tracker = { trackEvent: vi.fn() }; } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -69,7 +60,8 @@ describe( 'BannerVar.vue', () => { }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -144,7 +136,7 @@ describe( 'BannerVar.vue', () => { [ 'expectShowsCloseIcon' ], [ 'expectCloseIconEmitsCloseEvent' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerVar.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerVar.spec.ts index f34d3ae10..950f35f28 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerVar.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerVar.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test, vi } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/desktop/C24_WMDE_Desktop_DE_09/components/BannerVar.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; import { resetFormModel } from '@test/resetFormModel'; @@ -23,6 +18,8 @@ import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseSubmitTrackingFeaturesDesktop } from '@test/features/SoftCloseSubmitTrackingDesktop'; import { Tracker } from '@src/tracking/Tracker'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -32,18 +29,12 @@ describe( 'BannerVar.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); tracker = { trackEvent: vi.fn() }; } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -69,7 +60,8 @@ describe( 'BannerVar.vue', () => { }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -144,7 +136,7 @@ describe( 'BannerVar.vue', () => { [ 'expectShowsCloseIcon' ], [ 'expectCloseIconEmitsCloseEvent' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/FallbackBanner.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/FallbackBanner.spec.ts index 4fb6b49ab..e43797d7a 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/FallbackBanner.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_09/components/FallbackBanner.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import FallbackBanner from '@banners/desktop/C24_WMDE_Desktop_DE_09/components/FallbackBanner.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,19 +8,11 @@ import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { Tracker } from '@src/tracking/Tracker'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { fallbackBannerFeatures, submitFeatures } from '@test/features/FallbackBanner'; +import { TimerStub } from '@test/fixtures/TimerStub'; const translator = ( key: string ): string => key; describe( 'FallbackBanner.vue', () => { - - beforeEach( () => { - vi.useFakeTimers(); - } ); - - afterEach( () => { - vi.useRealTimers(); - } ); - const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null ): VueWrapper => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: width } ); return mount( FallbackBanner, { @@ -36,7 +28,8 @@ describe( 'FallbackBanner.vue', () => { provide: { translator: { translate: translator }, dynamicCampaignText: dynamicContent ?? newDynamicContent(), - tracker: tracker ?? new TrackerStub() + tracker: tracker ?? new TrackerStub(), + timer: new TimerStub() } } } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerCtrl.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerCtrl.spec.ts index 36fc9588d..276555e5a 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerCtrl.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test, vi } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; import { resetFormModel } from '@test/resetFormModel'; @@ -23,6 +18,8 @@ import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseSubmitTrackingFeaturesDesktop } from '@test/features/SoftCloseSubmitTrackingDesktop'; import { Tracker } from '@src/tracking/Tracker'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -32,18 +29,12 @@ describe( 'BannerVar.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); tracker = { trackEvent: vi.fn() }; } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -69,7 +60,8 @@ describe( 'BannerVar.vue', () => { }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -144,7 +136,7 @@ describe( 'BannerVar.vue', () => { [ 'expectShowsCloseIcon' ], [ 'expectCloseIconEmitsCloseEvent' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerVar.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerVar.spec.ts index 6b0f6915a..b8f0c9fe6 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerVar.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/BannerVar.spec.ts @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; import { resetFormModel } from '@test/resetFormModel'; @@ -23,6 +18,8 @@ import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseSubmitTrackingFeaturesDesktop } from '@test/features/SoftCloseSubmitTrackingDesktop'; import { Tracker } from '@src/tracking/Tracker'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -43,7 +40,7 @@ describe( 'BannerVar.vue', () => { vi.useRealTimers(); } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -69,7 +66,8 @@ describe( 'BannerVar.vue', () => { }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -144,7 +142,7 @@ describe( 'BannerVar.vue', () => { [ 'expectShowsCloseIcon' ], [ 'expectCloseIconEmitsCloseEvent' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/FallbackBanner.spec.ts b/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/FallbackBanner.spec.ts index bf3e1fe29..fbd00ec4f 100644 --- a/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/FallbackBanner.spec.ts +++ b/test/banners/desktop/C24_WMDE_Desktop_DE_10/components/FallbackBanner.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import FallbackBanner from '@banners/desktop/C24_WMDE_Desktop_DE_10/components/FallbackBanner.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,20 +8,13 @@ import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { Tracker } from '@src/tracking/Tracker'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { fallbackBannerFeatures, submitFeatures } from '@test/features/FallbackBanner'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const translator = ( key: string ): string => key; describe( 'FallbackBanner.vue', () => { - - beforeEach( () => { - vi.useFakeTimers(); - } ); - - afterEach( () => { - vi.useRealTimers(); - } ); - - const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null ): VueWrapper => { + const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null, timer: Timer = null ): VueWrapper => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: width } ); return mount( FallbackBanner, { props: { @@ -36,7 +29,8 @@ describe( 'FallbackBanner.vue', () => { provide: { translator: { translate: translator }, dynamicCampaignText: dynamicContent ?? newDynamicContent(), - tracker: tracker ?? new TrackerStub() + tracker: tracker ?? new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); diff --git a/test/banners/english/C24_WMDE_Desktop_EN_02b/components/BannerCtrl.spec.ts b/test/banners/english/C24_WMDE_Desktop_EN_02b/components/BannerCtrl.spec.ts index a257b7263..48efa9afa 100644 --- a/test/banners/english/C24_WMDE_Desktop_EN_02b/components/BannerCtrl.spec.ts +++ b/test/banners/english/C24_WMDE_Desktop_EN_02b/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/english/C24_WMDE_Desktop_EN_02b/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; @@ -21,6 +16,8 @@ import { bannerMainFeatures } from '@test/features/MainBanner'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -29,15 +26,9 @@ describe( 'BannerCtrl.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -55,7 +46,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); @@ -120,7 +112,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/english/C24_WMDE_Desktop_EN_02b/components/FallbackBanner.spec.ts b/test/banners/english/C24_WMDE_Desktop_EN_02b/components/FallbackBanner.spec.ts index ae1f3a681..b8b1645c6 100644 --- a/test/banners/english/C24_WMDE_Desktop_EN_02b/components/FallbackBanner.spec.ts +++ b/test/banners/english/C24_WMDE_Desktop_EN_02b/components/FallbackBanner.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import FallbackBanner from '@banners/english/C24_WMDE_Desktop_EN_02b/components/FallbackBanner.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,20 +8,13 @@ import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { Tracker } from '@src/tracking/Tracker'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { dynamicContentFeatures, fallbackBannerFeatures, submitFeatures } from '@test/features/FallbackBanner'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const translator = ( key: string ): string => key; describe( 'FallbackBanner.vue', () => { - - beforeEach( () => { - vi.useFakeTimers(); - } ); - - afterEach( () => { - vi.useRealTimers(); - } ); - - const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null ): VueWrapper => { + const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null, timer: Timer = null ): VueWrapper => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: width } ); return mount( FallbackBanner, { props: { @@ -36,7 +29,8 @@ describe( 'FallbackBanner.vue', () => { provide: { translator: { translate: translator }, dynamicCampaignText: dynamicContent ?? newDynamicContent(), - tracker: tracker ?? new TrackerStub() + tracker: tracker ?? new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); diff --git a/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerCtrl.spec.ts b/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerCtrl.spec.ts index ec9e9ec37..e7d64ead7 100644 --- a/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerCtrl.spec.ts +++ b/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/english/C24_WMDE_Desktop_EN_03/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; @@ -21,6 +16,8 @@ import { bannerMainFeatures } from '@test/features/MainBanner'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -29,15 +26,9 @@ describe( 'BannerCtrl.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -55,7 +46,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); @@ -120,7 +112,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerVar.spec.ts b/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerVar.spec.ts index 9ba7bff5b..c1fd85742 100644 --- a/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerVar.spec.ts +++ b/test/banners/english/C24_WMDE_Desktop_EN_03/components/BannerVar.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/english/C24_WMDE_Desktop_EN_03/components/BannerVar.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,12 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, - bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; @@ -22,23 +17,18 @@ import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { donationFormTransactionFeeFeatures } from '@test/features/forms/MainDonation_TransactionFee'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const formModel = useFormModel(); const translator = ( key: string, context: any ): string => context ? `${key} -- ${Object.entries( context )}` : key; describe( 'BannerCtrl.vue', () => { - beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); - } ); - - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { attachTo: document.body, props: { @@ -56,7 +46,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); @@ -121,7 +112,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/english/C24_WMDE_Desktop_EN_03/components/FallbackBanner.spec.ts b/test/banners/english/C24_WMDE_Desktop_EN_03/components/FallbackBanner.spec.ts index 21c50dc64..5f812ca06 100644 --- a/test/banners/english/C24_WMDE_Desktop_EN_03/components/FallbackBanner.spec.ts +++ b/test/banners/english/C24_WMDE_Desktop_EN_03/components/FallbackBanner.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import FallbackBanner from '@banners/english/C24_WMDE_Desktop_EN_03/components/FallbackBanner.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -8,20 +8,13 @@ import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { Tracker } from '@src/tracking/Tracker'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { dynamicContentFeatures, fallbackBannerFeatures, submitFeatures } from '@test/features/FallbackBanner'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const translator = ( key: string ): string => key; describe( 'FallbackBanner.vue', () => { - - beforeEach( () => { - vi.useFakeTimers(); - } ); - - afterEach( () => { - vi.useRealTimers(); - } ); - - const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null ): VueWrapper => { + const getWrapperAtWidth = ( width: number, dynamicContent: DynamicContent = null, tracker: Tracker = null, timer: Timer = null ): VueWrapper => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: width } ); return mount( FallbackBanner, { props: { @@ -36,7 +29,8 @@ describe( 'FallbackBanner.vue', () => { provide: { translator: { translate: translator }, dynamicCampaignText: dynamicContent ?? newDynamicContent(), - tracker: tracker ?? new TrackerStub() + tracker: tracker ?? new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); diff --git a/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerCtrl.spec.ts b/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerCtrl.spec.ts index 38a358532..65576eba8 100644 --- a/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerCtrl.spec.ts +++ b/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerCtrl.spec.ts @@ -19,6 +19,8 @@ import { formActionSwitchFeatures } from '@test/features/form_action_switch/Main import { Tracker } from '@src/tracking/Tracker'; import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures } from '@test/features/BannerContent'; import { softCloseSubmitTrackingFeatures } from '@test/features/SoftCloseSubmitTracking'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; let pageScroller: PageScroller; let tracker: Tracker; @@ -29,7 +31,6 @@ describe( 'BannerCtrl.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); pageScroller = { scrollIntoView: vi.fn(), @@ -41,7 +42,11 @@ describe( 'BannerCtrl.vue', () => { }; } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + afterEach( () => { + wrapper.unmount(); + } ); + + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -66,7 +71,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com/with-address', donateAnonymouslyAction: 'https://example.com/without-address' }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -74,12 +80,6 @@ describe( 'BannerCtrl.vue', () => { return wrapper; }; - afterEach( () => { - wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - describe( 'Content', () => { test.each( [ [ 'expectShowsAnimatedVisitorsVsDonorsSentenceInMessage' ], @@ -128,7 +128,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerVar.spec.ts b/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerVar.spec.ts index d65e99778..5055e3334 100644 --- a/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerVar.spec.ts +++ b/test/banners/mobile/C24_WMDE_Mobile_DE_06/components/BannerVar.spec.ts @@ -19,6 +19,8 @@ import { formActionSwitchFeatures } from '@test/features/form_action_switch/Main import { Tracker } from '@src/tracking/Tracker'; import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures } from '@test/features/BannerContent'; import { softCloseSubmitTrackingFeatures } from '@test/features/SoftCloseSubmitTracking'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; let pageScroller: PageScroller; let tracker: Tracker; @@ -29,7 +31,6 @@ describe( 'BannerVar.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); pageScroller = { scrollIntoView: vi.fn(), @@ -41,7 +42,11 @@ describe( 'BannerVar.vue', () => { }; } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + afterEach( () => { + wrapper.unmount(); + } ); + + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -66,7 +71,8 @@ describe( 'BannerVar.vue', () => { formActions: { donateWithAddressAction: 'https://example.com/with-address', donateAnonymouslyAction: 'https://example.com/without-address' }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -74,12 +80,6 @@ describe( 'BannerVar.vue', () => { return wrapper; }; - afterEach( () => { - wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - describe( 'Content', () => { test.each( [ [ 'expectShowsAnimatedVisitorsVsDonorsSentenceInMessage' ], @@ -128,7 +128,7 @@ describe( 'BannerVar.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerCtrl.spec.ts b/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerCtrl.spec.ts index 0dad827cb..ed7e33027 100644 --- a/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerCtrl.spec.ts +++ b/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerCtrl.spec.ts @@ -18,6 +18,8 @@ import { fullPageBannerFeatures } from '@test/features/FullPageBanner'; import { formActionSwitchFeatures } from '@test/features/form_action_switch/MainDonation_UpgradeToYearlyButton'; import { Tracker } from '@src/tracking/Tracker'; import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures } from '@test/features/BannerContent'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; let pageScroller: PageScroller; let tracker: Tracker; @@ -29,7 +31,6 @@ describe( 'BannerCtrl.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); pageScroller = { scrollIntoView: vi.fn(), @@ -41,7 +42,11 @@ describe( 'BannerCtrl.vue', () => { }; } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + afterEach( () => { + wrapper.unmount(); + } ); + + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -63,7 +68,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com/with-address', donateAnonymouslyAction: 'https://example.com/without-address' }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -71,12 +77,6 @@ describe( 'BannerCtrl.vue', () => { return wrapper; }; - afterEach( () => { - wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - describe( 'Content', () => { test.skip.each( [ [ 'expectShowsAnimatedVisitorsVsDonorsSentenceInMessage' ], @@ -125,7 +125,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerVar.spec.ts b/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerVar.spec.ts index 09a6f4edc..091f96803 100644 --- a/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerVar.spec.ts +++ b/test/banners/mobile_english/C24_WMDE_Mobile_EN_01/components/BannerVar.spec.ts @@ -19,6 +19,8 @@ import { formActionSwitchFeatures } from '@test/features/form_action_switch/Main import { Tracker } from '@src/tracking/Tracker'; import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures } from '@test/features/BannerContent'; import { UseOfFundsShownEvent } from '@src/tracking/events/UseOfFundsShownEvent'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; let pageScroller: PageScroller; let tracker: Tracker; @@ -30,7 +32,6 @@ describe( 'BannerVar.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); pageScroller = { scrollIntoView: vi.fn(), @@ -42,7 +43,11 @@ describe( 'BannerVar.vue', () => { }; } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + afterEach( () => { + wrapper.unmount(); + } ); + + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -64,7 +69,8 @@ describe( 'BannerVar.vue', () => { formActions: { donateWithAddressAction: 'https://example.com/with-address', donateAnonymouslyAction: 'https://example.com/without-address' }, currencyFormatter: new CurrencyEn(), formItems, - tracker + tracker, + timer: timer ?? new TimerStub() } } } ); @@ -72,12 +78,6 @@ describe( 'BannerVar.vue', () => { return wrapper; }; - afterEach( () => { - wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - describe( 'Content', () => { test.skip.each( [ [ 'expectShowsAnimatedVisitorsVsDonorsSentenceInMessage' ], @@ -126,7 +126,7 @@ describe( 'BannerVar.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerCtrl.spec.ts b/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerCtrl.spec.ts index ef6b16066..c234f0a28 100644 --- a/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerCtrl.spec.ts +++ b/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { afterEach, beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/pad/C24_WMDE_iPad_DE_01/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -15,6 +15,8 @@ import { useFormModel } from '@src/components/composables/useFormModel'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { bannerMainFeatures } from '@test/features/MainBanner'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -23,16 +25,13 @@ describe( 'BannerCtrl.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); } ); afterEach( () => { wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -52,7 +51,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); @@ -105,7 +105,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerVar.spec.ts b/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerVar.spec.ts index e94057ea2..909e12f39 100644 --- a/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerVar.spec.ts +++ b/test/banners/pad/C24_WMDE_iPad_DE_01/components/BannerVar.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { afterEach, beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/pad/C24_WMDE_iPad_DE_01/components/BannerVar.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -15,6 +15,8 @@ import { useFormModel } from '@src/components/composables/useFormModel'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { bannerMainFeatures } from '@test/features/MainBanner'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -23,16 +25,13 @@ describe( 'BannerCtrl.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); } ); afterEach( () => { wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -52,7 +51,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); @@ -105,7 +105,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/thank_you/components/BannerCtrl.de.spec.ts b/test/banners/thank_you/components/BannerCtrl.de.spec.ts index b2643fb06..bd1e3c4c6 100644 --- a/test/banners/thank_you/components/BannerCtrl.de.spec.ts +++ b/test/banners/thank_you/components/BannerCtrl.de.spec.ts @@ -14,6 +14,7 @@ import { ThankYouModalShownEvent } from '@src/tracking/events/ThankYouModalShown import { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent'; import { MembershipFormActions } from '@banners/thank_you/MembershipFormActions'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formActions: MembershipFormActions = { create: ( extraUrlParameters: Record ) => `URL [ ${ extraUrlParameters?.interval }, ${ extraUrlParameters?.fee } ]` @@ -40,7 +41,8 @@ describe( 'BannerCtrl.de.vue', () => { }, provide: { tracker: tracker, - formActions + formActions, + timer: new TimerStub() } } } ); diff --git a/test/banners/thank_you/components/BannerCtrl.en.spec.ts b/test/banners/thank_you/components/BannerCtrl.en.spec.ts index 7432e044a..eed71281d 100644 --- a/test/banners/thank_you/components/BannerCtrl.en.spec.ts +++ b/test/banners/thank_you/components/BannerCtrl.en.spec.ts @@ -14,6 +14,7 @@ import { ThankYouModalShownEvent } from '@src/tracking/events/ThankYouModalShown import { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent'; import { MembershipFormActions } from '@banners/thank_you/MembershipFormActions'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formActions: MembershipFormActions = { create: ( extraUrlParameters: Record ) => `URL [ ${ extraUrlParameters?.interval }, ${ extraUrlParameters?.fee } ]` @@ -40,7 +41,8 @@ describe( 'BannerCtrl.en.vue', () => { }, provide: { tracker: tracker, - formActions + formActions, + timer: new TimerStub() } } } ); diff --git a/test/banners/thank_you/components/BannerVar.de.spec.ts b/test/banners/thank_you/components/BannerVar.de.spec.ts index ce2a8cd5b..d9c2768d6 100644 --- a/test/banners/thank_you/components/BannerVar.de.spec.ts +++ b/test/banners/thank_you/components/BannerVar.de.spec.ts @@ -14,6 +14,7 @@ import { ThankYouModalShownEvent } from '@src/tracking/events/ThankYouModalShown import { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent'; import { MembershipFormActions } from '@banners/thank_you/MembershipFormActions'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formActions: MembershipFormActions = { create: ( extraUrlParameters: Record ) => `URL [ ${ extraUrlParameters?.interval }, ${ extraUrlParameters?.fee } ]` @@ -40,7 +41,8 @@ describe( 'BannerVar.de.vue', () => { }, provide: { tracker: tracker, - formActions + formActions, + timer: new TimerStub() } } } ); diff --git a/test/banners/thank_you/components/BannerVar.en.spec.ts b/test/banners/thank_you/components/BannerVar.en.spec.ts index 01167106a..44a19b7e4 100644 --- a/test/banners/thank_you/components/BannerVar.en.spec.ts +++ b/test/banners/thank_you/components/BannerVar.en.spec.ts @@ -14,6 +14,7 @@ import { ThankYouModalShownEvent } from '@src/tracking/events/ThankYouModalShown import { BannerSubmitEvent } from '@src/tracking/events/BannerSubmitEvent'; import { MembershipFormActions } from '@banners/thank_you/MembershipFormActions'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formActions: MembershipFormActions = { create: ( extraUrlParameters: Record ) => `URL [ ${ extraUrlParameters?.interval }, ${ extraUrlParameters?.fee } ]` @@ -40,7 +41,8 @@ describe( 'BannerVar.en.vue', () => { }, provide: { tracker: tracker, - formActions + formActions, + timer: new TimerStub() } } } ); diff --git a/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerCtrl.spec.ts b/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerCtrl.spec.ts index e8608dcd0..32e3e0817 100644 --- a/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerCtrl.spec.ts +++ b/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,11 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { useFormModel } from '@src/components/composables/useFormModel'; @@ -21,6 +17,8 @@ import { bannerMainFeatures } from '@test/features/MainBanner'; import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { setCookieImageFeatures } from '@test/features/SetCookieImage'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; const formModel = useFormModel(); const translator = ( key: string ): string => key; @@ -29,15 +27,9 @@ describe( 'BannerCtrl.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { props: { bannerState: BannerStates.Pending, @@ -54,7 +46,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } }, // Needed for isVisible checks, see https://test-utils.vuejs.org/api/#isVisible @@ -123,7 +116,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); @@ -135,7 +128,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectSetCookieImageOnAlreadyDonatedLink' ], [ 'expectSetsMaybeLaterCookieOnSoftCloseMaybeLater' ] ] )( '%s', async ( testName: string ) => { - await setCookieImageFeatures[ testName ]( getWrapper() ); + await setCookieImageFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerVar.spec.ts b/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerVar.spec.ts index a7309653e..11dac92d7 100644 --- a/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerVar.spec.ts +++ b/test/banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerVar.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, test, vi } from 'vitest'; +import { beforeEach, describe, test } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/wpde_desktop/C24_WPDE_Desktop_01/components/BannerVar.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -7,11 +7,7 @@ import { useOfFundsContent } from '@test/banners/useOfFundsContent'; import { formItems } from '@test/banners/formItems'; import { CurrencyEn } from '@src/utils/DynamicContent/formatters/CurrencyEn'; import { useOfFundsFeatures } from '@test/features/UseOfFunds'; -import { - bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, - bannerContentDisplaySwitchFeatures, - bannerContentFeatures -} from '@test/features/BannerContent'; +import { bannerContentAnimatedTextFeatures, bannerContentDateAndTimeFeatures, bannerContentDisplaySwitchFeatures, bannerContentFeatures } from '@test/features/BannerContent'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { donationFormFeatures } from '@test/features/forms/MainDonation_UpgradeToYearlyButton'; import { donationFormTransactionFeeFeatures } from '@test/features/forms/MainDonation_TransactionFee'; @@ -22,6 +18,8 @@ import { bannerMainFeatures } from '@test/features/MainBanner'; import { softCloseFeatures } from '@test/features/SoftCloseDesktop'; import { setCookieImageFeatures } from '@test/features/SetCookieImage'; import { alreadyDonatedModalFeatures } from '@test/features/AlreadyDonatedModal'; +import { Timer } from '@src/utils/Timer'; +import { TimerStub } from '@test/fixtures/TimerStub'; const formModel = useFormModel(); const translator = ( key: string, context: any ): string => context ? `${key} -- ${Object.entries( context )}` : key; @@ -30,15 +28,9 @@ describe( 'BannerVar.vue', () => { beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); } ); - afterEach( () => { - vi.restoreAllMocks(); - vi.useRealTimers(); - } ); - - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { return mount( Banner, { props: { bannerState: BannerStates.Pending, @@ -55,7 +47,8 @@ describe( 'BannerVar.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } }, // Needed for isVisible checks, see https://test-utils.vuejs.org/api/#isVisible @@ -134,7 +127,7 @@ describe( 'BannerVar.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); @@ -146,7 +139,7 @@ describe( 'BannerVar.vue', () => { [ 'expectSetCookieImageOnAlreadyDonatedLink' ], [ 'expectSetsMaybeLaterCookieOnSoftCloseMaybeLater' ] ] )( '%s', async ( testName: string ) => { - await setCookieImageFeatures[ testName ]( getWrapper() ); + await setCookieImageFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerCtrl.spec.ts b/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerCtrl.spec.ts index 4078fee64..aab086dd9 100644 --- a/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerCtrl.spec.ts +++ b/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerCtrl.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, vi, test } from 'vitest'; +import { afterEach, beforeEach, describe, test, vi } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerCtrl.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -17,6 +17,8 @@ import { resetFormModel } from '@test/resetFormModel'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { fullPageBannerFeatures } from '@test/features/FullPageBanner'; import { setCookieImageFeatures } from '@test/features/SetCookieImageMobile'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; let pageScroller: PageScroller; const formModel = useFormModel(); @@ -27,7 +29,6 @@ describe( 'BannerCtrl.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); pageScroller = { scrollIntoView: vi.fn(), @@ -37,11 +38,9 @@ describe( 'BannerCtrl.vue', () => { afterEach( () => { wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -62,7 +61,8 @@ describe( 'BannerCtrl.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); @@ -91,7 +91,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); @@ -100,7 +100,7 @@ describe( 'BannerCtrl.vue', () => { [ 'expectSetsCookieImageOnSoftCloseClose' ], [ 'expectSetsCookieImageOnSoftCloseTimeOut' ] ] )( '%s', async ( testName: string ) => { - await setCookieImageFeatures[ testName ]( getWrapper() ); + await setCookieImageFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerVar.spec.ts b/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerVar.spec.ts index 076db6212..9daa9ece2 100644 --- a/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerVar.spec.ts +++ b/test/banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerVar.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, vi, test } from 'vitest'; +import { afterEach, beforeEach, describe, test, vi } from 'vitest'; import { mount, VueWrapper } from '@vue/test-utils'; import Banner from '@banners/wpde_mobile/C24_WPDE_Mobile_01/components/BannerVar.vue'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; @@ -17,6 +17,8 @@ import { resetFormModel } from '@test/resetFormModel'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; import { fullPageBannerFeatures } from '@test/features/FullPageBanner'; import { setCookieImageFeatures } from '@test/features/SetCookieImageMobile'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; let pageScroller: PageScroller; const formModel = useFormModel(); @@ -27,7 +29,6 @@ describe( 'BannerVar.vue', () => { let wrapper: VueWrapper; beforeEach( () => { resetFormModel( formModel ); - vi.useFakeTimers(); pageScroller = { scrollIntoView: vi.fn(), @@ -37,11 +38,9 @@ describe( 'BannerVar.vue', () => { afterEach( () => { wrapper.unmount(); - vi.restoreAllMocks(); - vi.useRealTimers(); } ); - const getWrapper = ( dynamicContent: DynamicContent = null ): VueWrapper => { + const getWrapper = ( dynamicContent: DynamicContent = null, timer: Timer = null ): VueWrapper => { // attachTo the document body to fix an issue with Vue Test Utils where // clicking a submit button in a form does not fire the submit event wrapper = mount( Banner, { @@ -62,7 +61,8 @@ describe( 'BannerVar.vue', () => { formActions: { donateWithAddressAction: 'https://example.com', donateWithoutAddressAction: 'https://example.com' }, currencyFormatter: new CurrencyEn(), formItems, - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: timer ?? new TimerStub() } } } ); @@ -91,7 +91,7 @@ describe( 'BannerVar.vue', () => { [ 'expectEmitsBannerContentChangedOnSoftClose' ], [ 'expectDoesNotShowSoftCloseOnFinalBannerImpression' ] ] )( '%s', async ( testName: string ) => { - await softCloseFeatures[ testName ]( getWrapper() ); + await softCloseFeatures[ testName ]( getWrapper ); } ); } ); @@ -100,7 +100,7 @@ describe( 'BannerVar.vue', () => { [ 'expectSetsCookieImageOnSoftCloseClose' ], [ 'expectSetsCookieImageOnSoftCloseTimeOut' ] ] )( '%s', async ( testName: string ) => { - await setCookieImageFeatures[ testName ]( getWrapper() ); + await setCookieImageFeatures[ testName ]( getWrapper ); } ); } ); diff --git a/test/components/BannerConductor/BannerConductor.spec.ts b/test/components/BannerConductor/BannerConductor.spec.ts index 5f7840f48..5afd8c44e 100644 --- a/test/components/BannerConductor/BannerConductor.spec.ts +++ b/test/components/BannerConductor/BannerConductor.spec.ts @@ -15,6 +15,7 @@ import { ReactiveProperty } from '@src/domain/StateMachine/ReactiveProperty'; import { BannerState } from '@src/components/BannerConductor/StateMachine/states/BannerState'; import { CloseEvent } from '@src/tracking/events/CloseEvent'; import { ResizeHandler } from '@src/utils/ResizeHandler'; +import { TimerStub } from '@test/fixtures/TimerStub'; vi.mock( '@src/components/BannerConductor/StateMachine/BannerStateMachine', async () => { const actual = await vi.importActual( '@src/components/BannerConductor/StateMachine/BannerStateMachine' ); @@ -63,7 +64,8 @@ describe( 'BannerConductor.vue', () => { }, global: { provide: { - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: new TimerStub() } } } ); diff --git a/test/components/BannerConductor/FallbackBannerConductor.spec.ts b/test/components/BannerConductor/FallbackBannerConductor.spec.ts index 5f8cdabac..5ffb7e855 100644 --- a/test/components/BannerConductor/FallbackBannerConductor.spec.ts +++ b/test/components/BannerConductor/FallbackBannerConductor.spec.ts @@ -15,6 +15,7 @@ import { ReactiveProperty } from '@src/domain/StateMachine/ReactiveProperty'; import { BannerState } from '@src/components/BannerConductor/StateMachine/states/BannerState'; import { CloseEvent } from '@src/tracking/events/CloseEvent'; import { ResizeHandler } from '@src/utils/ResizeHandler'; +import { TimerStub } from '@test/fixtures/TimerStub'; vi.mock( '@src/components/BannerConductor/StateMachine/BannerStateMachine', async () => { const actual = await vi.importActual( '@src/components/BannerConductor/StateMachine/BannerStateMachine' ); @@ -71,7 +72,8 @@ describe( 'FallbackBannerConductor.vue', () => { }, global: { provide: { - tracker: new TrackerStub() + tracker: new TrackerStub(), + timer: new TimerStub() } } } ); diff --git a/test/components/BannerConductor/StateMachine/states/ClosedState.spec.ts b/test/components/BannerConductor/StateMachine/states/ClosedState.spec.ts index 5797f5df1..149c4f0d7 100644 --- a/test/components/BannerConductor/StateMachine/states/ClosedState.spec.ts +++ b/test/components/BannerConductor/StateMachine/states/ClosedState.spec.ts @@ -5,12 +5,20 @@ import { PageStub } from '@test/fixtures/PageStub'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { ResizeHandlerStub } from '@test/fixtures/ResizeHandlerStub'; import { CloseChoices } from '@src/domain/CloseChoices'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; describe( 'ClosedState', function () { it( 'tracks close event on enter', function () { const tracker = { trackEvent: vitest.fn() }; const closeEvent = new CloseEvent( 'MainBanner', CloseChoices.Close ); - const state = new ClosedState( closeEvent, new PageStub(), tracker, new ResizeHandlerStub() ); + const state = new ClosedState( + closeEvent, + new PageStub(), + tracker, + new ResizeHandlerStub(), + new TimerStub() + ); state.enter(); @@ -21,7 +29,13 @@ describe( 'ClosedState', function () { const page = new PageStub(); page.setSpace = vitest.fn( () => page ); page.unsetAnimated = vitest.fn( () => page ); - const state = new ClosedState( new CloseEvent( 'MainBanner', CloseChoices.Close ), page, new TrackerStub(), new ResizeHandlerStub() ); + const state = new ClosedState( + new CloseEvent( 'MainBanner', CloseChoices.Close ), + page, + new TrackerStub(), + new ResizeHandlerStub(), + new TimerStub() + ); state.enter(); @@ -33,7 +47,13 @@ describe( 'ClosedState', function () { const page = new PageStub(); page.setCloseCookieIfNecessary = vitest.fn( () => page ); const closeEvent = new CloseEvent( 'MainBanner', CloseChoices.Close ); - const state = new ClosedState( closeEvent, page, new TrackerStub(), new ResizeHandlerStub() ); + const state = new ClosedState( + closeEvent, + page, + new TrackerStub(), + new ResizeHandlerStub(), + new TimerStub() + ); state.enter(); @@ -46,7 +66,13 @@ describe( 'ClosedState', function () { const resizeHandler = new ResizeHandlerStub(); page.removePageEventListeners = vitest.fn( () => page ); resizeHandler.onClose = vitest.fn(); - const state = new ClosedState( new CloseEvent( 'MainBanner', CloseChoices.Close ), page, new TrackerStub(), resizeHandler ); + const state = new ClosedState( + new CloseEvent( 'MainBanner', CloseChoices.Close ), + page, + new TrackerStub(), + resizeHandler, + new TimerStub() + ); state.enter(); @@ -54,12 +80,28 @@ describe( 'ClosedState', function () { expect( resizeHandler.onClose ).toHaveBeenCalledOnce(); } ); + it( 'stops the timers', function () { + const timer = new TimerSpy(); + const state = new ClosedState( + new CloseEvent( 'MainBanner', CloseChoices.Close ), + new PageStub(), + new TrackerStub(), + new ResizeHandlerStub(), + timer + ); + + state.enter(); + + expect( timer.clearAllCalls ).toStrictEqual( 1 ); + } ); + it( 'throws error on exit', function () { const state = new ClosedState( new CloseEvent( 'MainBanner', CloseChoices.Close ), new PageStub(), new TrackerStub(), - new ResizeHandlerStub() + new ResizeHandlerStub(), + new TimerStub() ); expect( () => state.exit() ).toThrowError( 'This state will never be exited' ); diff --git a/test/components/BannerConductor/StateMachine/states/NotShownState.spec.ts b/test/components/BannerConductor/StateMachine/states/NotShownState.spec.ts index 5cfa0ab99..cba557832 100644 --- a/test/components/BannerConductor/StateMachine/states/NotShownState.spec.ts +++ b/test/components/BannerConductor/StateMachine/states/NotShownState.spec.ts @@ -5,6 +5,8 @@ import { NotShownEvent } from '@src/tracking/events/NotShownEvent'; import { PageStub } from '@test/fixtures/PageStub'; import { TrackerStub } from '@test/fixtures/TrackerStub'; import { ResizeHandlerStub } from '@test/fixtures/ResizeHandlerStub'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; describe( 'NotShownState', function () { it( 'tracks not shown event on enter', function () { @@ -12,8 +14,20 @@ describe( 'NotShownState', function () { Object.defineProperty( window, 'innerHeight', { writable: true, configurable: true, value: 200 } ); const tracker = { trackEvent: vitest.fn() }; - const trackingEvent = new NotShownEvent( { bannerHeight: 0, viewportHeight: 200, viewportWidth: 100, reason: BannerNotShownReasons.DisallowedNamespace } ); - const state = new NotShownState( BannerNotShownReasons.DisallowedNamespace, new PageStub(), tracker, new ResizeHandlerStub(), 0 ); + const trackingEvent = new NotShownEvent( { + bannerHeight: 0, + viewportHeight: 200, + viewportWidth: 100, + reason: BannerNotShownReasons.DisallowedNamespace + } ); + const state = new NotShownState( + BannerNotShownReasons.DisallowedNamespace, + new PageStub(), + tracker, + new ResizeHandlerStub(), + 0, + new TimerStub() + ); state.enter(); @@ -29,7 +43,14 @@ describe( 'NotShownState', function () { viewportWidth: window.innerWidth, viewportHeight: window.innerHeight } ); - const state = new NotShownState( BannerNotShownReasons.SizeIssue, new PageStub(), tracker, new ResizeHandlerStub(), 300 ); + const state = new NotShownState( + BannerNotShownReasons.SizeIssue, + new PageStub(), + tracker, + new ResizeHandlerStub(), + 300, + new TimerStub() + ); state.enter(); @@ -40,7 +61,14 @@ describe( 'NotShownState', function () { it( 'marks banner as not shown on enter', function () { const page = new PageStub(); page.preventImpressionCountForHiddenBanner = vitest.fn( () => page ); - const state = new NotShownState( BannerNotShownReasons.SizeIssue, page, new TrackerStub(), new ResizeHandlerStub(), 0 ); + const state = new NotShownState( + BannerNotShownReasons.SizeIssue, + page, + new TrackerStub(), + new ResizeHandlerStub(), + 0, + new TimerStub() + ); state.enter(); @@ -52,7 +80,14 @@ describe( 'NotShownState', function () { const resizeHandler = new ResizeHandlerStub(); page.removePageEventListeners = vitest.fn( () => page ); resizeHandler.onClose = vitest.fn(); - const state = new NotShownState( BannerNotShownReasons.UserInteraction, page, new TrackerStub(), resizeHandler, 0 ); + const state = new NotShownState( + BannerNotShownReasons.UserInteraction, + page, + new TrackerStub(), + resizeHandler, + 0, + new TimerStub() + ); state.enter(); @@ -60,13 +95,30 @@ describe( 'NotShownState', function () { expect( resizeHandler.onClose ).toHaveBeenCalledOnce(); } ); + it( 'clears the timers', function () { + const timer = new TimerSpy(); + const state = new NotShownState( + BannerNotShownReasons.UserInteraction, + new PageStub(), + new TrackerStub(), + new ResizeHandlerStub(), + 0, + timer + ); + + state.enter(); + + expect( timer.clearAllCalls ).toStrictEqual( 1 ); + } ); + it( 'throws error on exit', function () { const state = new NotShownState( BannerNotShownReasons.UserInteraction, new PageStub(), new TrackerStub(), new ResizeHandlerStub(), - 0 + 0, + new TimerStub() ); expect( () => state.exit() ).toThrowError( 'This state will never be exited' ); diff --git a/test/components/BannerConductor/StateMachine/states/PendingState.spec.ts b/test/components/BannerConductor/StateMachine/states/PendingState.spec.ts index a58e3eace..fca973862 100644 --- a/test/components/BannerConductor/StateMachine/states/PendingState.spec.ts +++ b/test/components/BannerConductor/StateMachine/states/PendingState.spec.ts @@ -1,6 +1,8 @@ import { beforeEach, describe, expect, it, vitest } from 'vitest'; import { PendingState } from '@src/components/BannerConductor/StateMachine/states/PendingState'; import { Page } from '@src/page/Page'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; describe( 'PendingState', function () { let page: Page; @@ -10,7 +12,7 @@ describe( 'PendingState', function () { } ); it( 'sets banner height on enter', async () => { - const pendingState = new PendingState( page, 60, 1 ); + const pendingState = new PendingState( page, 60, 1, new TimerStub() ); await pendingState.enter(); @@ -19,26 +21,29 @@ describe( 'PendingState', function () { } ); it( 'starts delay timeout on enter', async () => { - const setTimeoutSpy = vitest.spyOn( window, 'setTimeout' ); - const pendingState = new PendingState( page, 60, 1 ); + const timerSpy = new TimerSpy(); + + const pendingState = new PendingState( page, 60, 1, timerSpy ); await pendingState.enter(); - expect( setTimeoutSpy ).toHaveBeenCalledOnce(); - expect( setTimeoutSpy ).toHaveBeenCalledWith( expect.any( Function ), 1 ); + expect( timerSpy.setTimeoutCalls.length ).toStrictEqual( 1 ); + expect( timerSpy.setTimeoutCalls[ 0 ] ).toStrictEqual( 1 ); } ); it( 'stops delay timeout on exit', async () => { - const clearTimeoutSpy = vitest.spyOn( window, 'clearTimeout' ); - const pendingState = new PendingState( page, 60, 1 ); + const timerSpy = new TimerSpy(); + const pendingState = new PendingState( page, 60, 1, timerSpy ); + await pendingState.enter(); await pendingState.exit(); - expect( clearTimeoutSpy ).toHaveBeenCalledOnce(); + expect( timerSpy.clearTimeoutIds.length ).toStrictEqual( 1 ); + expect( timerSpy.clearTimeoutIds[ 0 ] ).toStrictEqual( 0 ); } ); it( 'sets banner size on resize', () => { - const pendingState = new PendingState( page, 60, 1 ); + const pendingState = new PendingState( page, 60, 1, new TimerStub() ); pendingState.onResize( 42 ); diff --git a/test/components/BannerConductor/StateMachine/states/ShowingState.spec.ts b/test/components/BannerConductor/StateMachine/states/ShowingState.spec.ts index 332ba1997..2b19d52f4 100644 --- a/test/components/BannerConductor/StateMachine/states/ShowingState.spec.ts +++ b/test/components/BannerConductor/StateMachine/states/ShowingState.spec.ts @@ -2,6 +2,8 @@ import { beforeEach, describe, expect, it, vitest } from 'vitest'; import { ShowingState } from '@src/components/BannerConductor/StateMachine/states/ShowingState'; import { Page } from '@src/page/Page'; import { PageStub } from '@test/fixtures/PageStub'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; describe( 'ShowingState', function () { let page: Page; @@ -15,7 +17,7 @@ describe( 'ShowingState', function () { } ); it( 'shows banner on enter', async () => { - const showingState = new ShowingState( page, 1 ); + const showingState = new ShowingState( page, 1, new TimerStub() ); await showingState.enter(); @@ -26,26 +28,29 @@ describe( 'ShowingState', function () { } ); it( 'starts transitionDuration timeout on enter', async () => { - const setTimeoutSpy = vitest.spyOn( window, 'setTimeout' ); - const showingState = new ShowingState( page, 1 ); + const timerSpy = new TimerSpy(); + + const showingState = new ShowingState( page, 1, timerSpy ); await showingState.enter(); - expect( setTimeoutSpy ).toHaveBeenCalledOnce(); - expect( setTimeoutSpy ).toHaveBeenCalledWith( expect.any( Function ), 1 ); + expect( timerSpy.setTimeoutCalls.length ).toStrictEqual( 1 ); + expect( timerSpy.setTimeoutCalls[ 0 ] ).toStrictEqual( 1 ); } ); it( 'stops delay timeout on exit', async () => { - const clearTimeoutSpy = vitest.spyOn( window, 'clearTimeout' ); - const showingState = new ShowingState( page, 1 ); + const timerSpy = new TimerSpy(); + const showingState = new ShowingState( page, 1, timerSpy ); + await showingState.enter(); await showingState.exit(); - expect( clearTimeoutSpy ).toHaveBeenCalledOnce(); + expect( timerSpy.clearTimeoutIds.length ).toStrictEqual( 1 ); + expect( timerSpy.clearTimeoutIds[ 0 ] ).toStrictEqual( 0 ); } ); it( 'sets banner size on resize', () => { - const showingState = new ShowingState( page, 1 ); + const showingState = new ShowingState( page, 1, new TimerStub() ); showingState.onResize( 42 ); @@ -54,7 +59,7 @@ describe( 'ShowingState', function () { } ); it( 'sets banner size on content changed', () => { - const showingState = new ShowingState( page, 1 ); + const showingState = new ShowingState( page, 1, new TimerStub() ); showingState.onContentChanged( 42 ); diff --git a/test/components/DonationForm/MultiStepDonation.spec.ts b/test/components/DonationForm/MultiStepDonation.spec.ts index 8bc217654..e54e45231 100644 --- a/test/components/DonationForm/MultiStepDonation.spec.ts +++ b/test/components/DonationForm/MultiStepDonation.spec.ts @@ -6,6 +6,7 @@ import { StepController } from '@src/components/DonationForm/StepController'; import { PageScroller } from '@src/utils/PageScroller/PageScroller'; import { StepControllerSpy } from '@test/fixtures/StepControllerSpy'; import { TrackerSpy } from '@test/fixtures/TrackerSpy'; +import { TimerStub } from '@test/fixtures/TimerStub'; const subFormEmitterTemplate = `` + }, + global: { + provide: { + timer: timer ?? new TimerStub() + } } } ); }; @@ -42,42 +50,43 @@ describe( 'KeenSlider', () => { expect( firstSlideContent.attributes().class ).toContain( 'wmde-banner-slide--current' ); } ); - // Keen seems to be slow in transitioning between slides so while the slider has started to move - // it takes a long time until the transition ends. That means this test is pretty brittle - it.todo( 'should advance the slides after the interval when the slider has started', async () => { - const wrapper = getWrapper(); + it( 'should advance the slides after the interval when the slider has started', async () => { + const timerSpy = new TimerSpy(); + timerSpy.setTimeout = ( fn: () => void ): number => { + fn(); + return 0; + }; + const wrapper = getWrapper( timerSpy ); await wrapper.setProps( { play: true } ); - await vi.advanceTimersByTimeAsync( 199 ); - expect( wrapper.find( '.wmde-banner-slide:nth-child(1) .wmde-banner-slide--current' ).exists() ).toBeTruthy(); - - await vi.advanceTimersByTimeAsync( 2 ); - expect( wrapper.find( '.wmde-banner-slide:nth-child(2) .wmde-banner-slide--current' ).exists() ).toBeTruthy(); + expect( timerSpy.setIntervalCalls.length ).toStrictEqual( 1 ); + expect( timerSpy.setIntervalCalls[ 0 ] ).toStrictEqual( 200 ); } ); - it.todo( 'should emit when the slide changes', async () => { + /** + * We can't test this as it requires an internal function in Keen that waits for the slide animation + * which seems to take a very long time in the test environment. + */ + it.skip( 'should emit when the slide changes', async () => { const wrapper = getWrapper(); await wrapper.setProps( { play: true } ); await wrapper.find( '.wmde-banner-slider-navigation-next' ).trigger( 'click' ); - await vi.advanceTimersByTimeAsync( 200 ); expect( wrapper.emitted( 'slide-changed' ).length ).toBe( 1 ); expect( wrapper.emitted( 'slide-changed' )[ 0 ][ 0 ] ).toBe( 1 ); } ); it( 'should start after a delay if one is passed', async () => { - const wrapper = getWrapper(); + const timerSpy = new TimerSpy(); + const wrapper = getWrapper( timerSpy ); await wrapper.setProps( { startDelay: 100 } ); await wrapper.setProps( { play: true } ); - await vi.advanceTimersByTimeAsync( 99 ); - expect( wrapper.find( '.wmde-banner-slider--pending' ).exists() ).toBeTruthy(); - - await vi.advanceTimersByTimeAsync( 2 ); - expect( wrapper.find( '.wmde-banner-slider--playing' ).exists() ).toBeTruthy(); + expect( timerSpy.setTimeoutCalls.length ).toStrictEqual( 1 ); + expect( timerSpy.setTimeoutCalls[ 0 ] ).toStrictEqual( 100 ); } ); it( 'should show a pagination dot for each exising slide', async () => { diff --git a/test/components/SoftClose/SoftClose.spec.ts b/test/components/SoftClose/SoftClose.spec.ts index b9ea06f0c..6e9ed4bed 100644 --- a/test/components/SoftClose/SoftClose.spec.ts +++ b/test/components/SoftClose/SoftClose.spec.ts @@ -1,7 +1,10 @@ import { describe, expect, it, afterEach, beforeEach, vi } from 'vitest'; -import { mount, shallowMount } from '@vue/test-utils'; +import { mount, VueWrapper } from '@vue/test-utils'; import SoftClose from '@src/components/SoftClose/SoftClose.vue'; import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue'; +import { TimerStub } from '@test/fixtures/TimerStub'; +import { Timer } from '@src/utils/Timer'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; describe( 'SoftClose', function () { @@ -13,14 +16,21 @@ describe( 'SoftClose', function () { vi.restoreAllMocks(); } ); - it( 'should emit close event when user clicks close button', function () { - const wrapper = shallowMount( SoftClose, { + const getWrapper = ( translate: ( key: string ) => string = ( key: string ) => key, timer: Timer = null ): VueWrapper => { + return mount( SoftClose, { global: { mocks: { - $translate: ( key: string ) => key + $translate: translate + }, + provide: { + timer: timer ?? new TimerStub() } } } ); + }; + + it( 'should emit close event when user clicks close button', function () { + const wrapper = getWrapper(); wrapper.find( '.wmde-banner-soft-close-button-close' ).trigger( 'click' ); @@ -28,13 +38,7 @@ describe( 'SoftClose', function () { } ); it( 'should emit maybeLater event when user clicks maybe later button', function () { - const wrapper = shallowMount( SoftClose, { - global: { - mocks: { - $translate: ( key: string ) => key - } - } - } ); + const wrapper = getWrapper(); wrapper.find( '.wmde-banner-soft-close-button-maybe-later' ).trigger( 'click' ); @@ -42,87 +46,60 @@ describe( 'SoftClose', function () { } ); it( 'should display the remaining seconds decremented every second', async () => { - const wrapper = shallowMount( SoftClose, { - global: { - mocks: { - $translate: ( key: string, templateTags: Record = {} ) => { - return templateTags === undefined ? key : templateTags.seconds; - } - } - } - } ); + const translate = ( key: string, templateTags: Record = {} ): string => { + return templateTags === undefined ? key : templateTags.seconds?.toString(); + }; + const timer = new TimerSpy(); + + const wrapper = getWrapper( translate, timer ); const seconds = wrapper.find( '.wmde-banner-soft-close-countdown-text-wrapper' ); expect( seconds.text() ).toBe( '15' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( seconds.text() ).toBe( '14' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( seconds.text() ).toBe( '13' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( seconds.text() ).toBe( '12' ); } ); - it( 'should emit timeOutClose when the internal countdown is <= 1', () => { - const wrapper = shallowMount( SoftClose, { - global: { - mocks: { - $translate: ( key: string ) => key - } - } - } ); - vi.runAllTimers(); + it( 'should emit timeOutClose when the internal countdown is <= 1', async () => { + const timer = new TimerSpy(); + const wrapper = getWrapper( ( key: string ) => key, timer ); + + // The soft close counts down over 15 seconds so we need to keep advancing until it runs out + for ( let i: number = 0; i < 15; i++ ) { + await timer.advanceInterval(); + } + expect( wrapper.emitted( 'timeOutClose' ).length ).toBe( 1 ); } ); - it( 'should not show the extra close icon', () => { - const wrapper = shallowMount( SoftClose, { - props: { - showCloseIcon: false - }, - global: { - mocks: { - $translate: ( key: string ) => key - } - } - } ); + it( 'should not show the extra close icon', async () => { + const wrapper = getWrapper(); + await wrapper.setProps( { showCloseIcon: false } ); expect( wrapper.classes() ).not.toContain( 'wmde-banner-soft-close-with-close-icon' ); expect( wrapper.findComponent( ButtonClose ).exists() ).toBeFalsy(); } ); - it( 'should show the extra close icon', () => { - const wrapper = shallowMount( SoftClose, { - props: { - showCloseIcon: true - }, - global: { - mocks: { - $translate: ( key: string ) => key - } - } - } ); + it( 'should show the extra close icon', async () => { + const wrapper = getWrapper(); + await wrapper.setProps( { showCloseIcon: true } ); expect( wrapper.classes() ).toContain( 'wmde-banner-soft-close-with-close-icon' ); expect( wrapper.findComponent( ButtonClose ).exists() ).toBeTruthy(); } ); - it( 'should emit close event when user clicks close icon', function () { - const wrapper = mount( SoftClose, { - props: { - showCloseIcon: true - }, - global: { - mocks: { - $translate: ( key: string ) => key - } - } - } ); + it( 'should emit close event when user clicks close icon', async () => { + const wrapper = getWrapper(); + await wrapper.setProps( { showCloseIcon: true } ); - wrapper.findComponent( ButtonClose ).trigger( 'click' ); + await wrapper.findComponent( ButtonClose ).trigger( 'click' ); expect( wrapper.emitted( 'close' ).length ).toBe( 1 ); } ); diff --git a/test/features/BannerContent.ts b/test/features/BannerContent.ts index 53d6e1978..b28e3b26e 100644 --- a/test/features/BannerContent.ts +++ b/test/features/BannerContent.ts @@ -3,12 +3,12 @@ import { BannerStates } from '@src/components/BannerConductor/StateMachine/Banne import { expect, vi } from 'vitest'; import { newDynamicContent } from '@test/banners/dynamicCampaignContent'; import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; +import { Timer } from '@src/utils/Timer'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; const expectSlideShowPlaysWhenBecomesVisible = async ( wrapper: VueWrapper ): Promise => { await wrapper.setProps( { bannerState: BannerStates.Visible } ); - await vi.runOnlyPendingTimersAsync(); - expect( wrapper.find( '.wmde-banner-slider--playing' ).exists() ).toBeTruthy(); }; @@ -16,8 +16,6 @@ const expectSlideShowStopsOnFormInteraction = async ( wrapper: VueWrapper ) await wrapper.setProps( { bannerState: BannerStates.Visible } ); await wrapper.find( '.wmde-banner-form' ).trigger( 'click' ); - await vi.runOnlyPendingTimersAsync(); - expect( wrapper.find( '.wmde-banner-slider--stopped' ).exists() ).toBeTruthy(); }; @@ -65,47 +63,49 @@ const expectShowsAnimatedVisitorsVsDonorsSentenceInSlideShow = async ( getWrappe expect( wrapper.find( '.wmde-banner-slider .wmde-banner-text-animated-highlight' ).exists() ).toBeTruthy(); }; -const expectShowsLiveDateAndTimeInMessage = async ( getWrapper: ( dynamicContent: DynamicContent ) => VueWrapper ): Promise => { +const expectShowsLiveDateAndTimeInMessage = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: 1301 } ); const dynamicContent = newDynamicContent(); dynamicContent.getCurrentDateAndTime = vi.fn().mockReturnValueOnce( { currentDate: 'Initial Date', currentTime: 'Initial Time' } ) .mockReturnValueOnce( { currentDate: 'Second Date', currentTime: 'Second Time' } ) .mockReturnValueOnce( { currentDate: 'Third Date', currentTime: 'Third Time' } ); - const wrapper = getWrapper( dynamicContent ); + const timer = new TimerSpy(); + const wrapper = getWrapper( dynamicContent, timer ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Initial Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Initial Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Second Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Second Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Third Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Third Time' ); }; -const expectShowsLiveDateAndTimeInSlideshow = async ( getWrapper: ( dynamicContent: DynamicContent ) => VueWrapper ): Promise => { +const expectShowsLiveDateAndTimeInSlideshow = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { Object.defineProperty( window, 'innerWidth', { writable: true, configurable: true, value: 1300 } ); const dynamicContent = newDynamicContent(); dynamicContent.getCurrentDateAndTime = vi.fn().mockReturnValueOnce( { currentDate: 'Initial Date', currentTime: 'Initial Time' } ) .mockReturnValueOnce( { currentDate: 'Second Date', currentTime: 'Second Time' } ) .mockReturnValueOnce( { currentDate: 'Third Date', currentTime: 'Third Time' } ); - const wrapper = getWrapper( dynamicContent ); + const timer = new TimerSpy(); + const wrapper = getWrapper( dynamicContent, timer ); expect( wrapper.find( '.wmde-banner-slider' ).text() ).toContain( 'Initial Date' ); expect( wrapper.find( '.wmde-banner-slider' ).text() ).toContain( 'Initial Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-slider' ).text() ).toContain( 'Second Date' ); expect( wrapper.find( '.wmde-banner-slider' ).text() ).toContain( 'Second Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-slider' ).text() ).toContain( 'Third Date' ); expect( wrapper.find( '.wmde-banner-slider' ).text() ).toContain( 'Third Time' ); @@ -131,7 +131,7 @@ const expectShowsAverageDonationInSlideshow = async ( getWrapper: ( dynamicConte expect( wrapper.find( '.wmde-banner-slider' ).text() ).toContain( '== Average Donation ==' ); }; -const expectShowsLiveDateAndTimeInMiniBanner = async ( getWrapper: ( dynamicContent: DynamicContent ) => VueWrapper ): Promise => { +const expectShowsLiveDateAndTimeInMiniBanner = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { const dynamicContent = newDynamicContent(); // There are 2 live text elements mounted at the same time in the mobile banners meaning it will be initialised twice dynamicContent.getCurrentDateAndTime = vi.fn().mockReturnValueOnce( { currentDate: 'Initial Date', currentTime: 'Initial Time' } ) @@ -139,23 +139,24 @@ const expectShowsLiveDateAndTimeInMiniBanner = async ( getWrapper: ( dynamicCont .mockReturnValueOnce( { currentDate: 'Second Date', currentTime: 'Second Time' } ) .mockReturnValueOnce( { currentDate: 'Third Date', currentTime: 'Third Time' } ); - const wrapper = getWrapper( dynamicContent ); + const timer = new TimerSpy(); + const wrapper = getWrapper( dynamicContent, timer ); expect( wrapper.find( '.wmde-banner-mini-slideshow' ).text() ).toContain( 'Initial Date' ); expect( wrapper.find( '.wmde-banner-mini-slideshow' ).text() ).toContain( 'Initial Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-mini-slideshow' ).text() ).toContain( 'Second Date' ); expect( wrapper.find( '.wmde-banner-mini-slideshow' ).text() ).toContain( 'Second Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-mini-slideshow' ).text() ).toContain( 'Third Date' ); expect( wrapper.find( '.wmde-banner-mini-slideshow' ).text() ).toContain( 'Third Time' ); }; -const expectShowsLiveDateAndTimeInFullPageBanner = async ( getWrapper: ( dynamicContent: DynamicContent ) => VueWrapper ): Promise => { +const expectShowsLiveDateAndTimeInFullPageBanner = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { const dynamicContent = newDynamicContent(); // There are 2 live text elements mounted at the same time in the mobile banners meaning it will be initialised twice dynamicContent.getCurrentDateAndTime = vi.fn().mockReturnValueOnce( { currentDate: 'Initial Date', currentTime: 'Initial Time' } ) @@ -163,19 +164,20 @@ const expectShowsLiveDateAndTimeInFullPageBanner = async ( getWrapper: ( dynamic .mockReturnValueOnce( { currentDate: 'Second Date', currentTime: 'Second Time' } ) .mockReturnValueOnce( { currentDate: 'Third Date', currentTime: 'Third Time' } ); - const wrapper = getWrapper( dynamicContent ); + const timer = new TimerSpy(); + const wrapper = getWrapper( dynamicContent, timer ); await wrapper.find( '.wmde-banner-mini-button' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Initial Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Initial Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Second Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Second Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Third Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Third Time' ); diff --git a/test/features/FallbackBanner.ts b/test/features/FallbackBanner.ts index d1ff9b58a..9b60246d0 100644 --- a/test/features/FallbackBanner.ts +++ b/test/features/FallbackBanner.ts @@ -8,6 +8,8 @@ import { BannerStates } from '@src/components/BannerConductor/StateMachine/Banne import { newDynamicContent } from '@test/banners/dynamicCampaignContent'; import { TrackerSpy } from '@test/fixtures/TrackerSpy'; import { FallbackBannerSubmitEvent } from '@src/tracking/events/FallbackBannerSubmitEvent'; +import { Timer } from '@src/utils/Timer'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; const showsTheSmallBanner = async ( getWrapperAtWidth: ( width: number ) => VueWrapper ): Promise => { const wrapper = getWrapperAtWidth( 799 ); @@ -36,7 +38,6 @@ const playsTheSlideshowWhenBecomesVisible = async ( getWrapperAtWidth: ( width: const wrapper = getWrapperAtWidth( 799 ); await wrapper.setProps( { bannerState: BannerStates.Visible } ); - await vi.runOnlyPendingTimersAsync(); expect( wrapper.find( '.wmde-banner-slider--playing' ).exists() ).toBeTruthy(); }; @@ -83,23 +84,29 @@ const showsTheAnimatedHighlightInLargeBanner = async ( getWrapperAtWidth: ( widt expect( wrapper.find( '.wmde-banner-message .wmde-banner-text-animated-highlight' ).exists() ).toBeTruthy(); }; -const showsLiveTimeInLargeBanner = async ( getWrapperAtWidth: ( width: number, dynamicContent: DynamicContent ) => VueWrapper ): Promise => { +const showsLiveTimeInLargeBanner = async ( getWrapperAtWidth: ( + width: number, + dynamicContent: DynamicContent, + tracker: Tracker, + timer: Timer +) => VueWrapper ): Promise => { const dynamicContent = newDynamicContent(); dynamicContent.getCurrentDateAndTime = vi.fn().mockReturnValueOnce( { currentDate: 'Initial Date', currentTime: 'Initial Time' } ) .mockReturnValueOnce( { currentDate: 'Second Date', currentTime: 'Second Time' } ) .mockReturnValueOnce( { currentDate: 'Third Date', currentTime: 'Third Time' } ); - const wrapper = getWrapperAtWidth( 800, dynamicContent ); + const timer = new TimerSpy(); + const wrapper = getWrapperAtWidth( 800, dynamicContent, null, timer ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Initial Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Initial Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Second Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Second Time' ); - await vi.advanceTimersByTimeAsync( 1000 ); + await timer.advanceInterval(); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Third Date' ); expect( wrapper.find( '.wmde-banner-message' ).text() ).toContain( 'Third Time' ); diff --git a/test/features/MiniBanner.ts b/test/features/MiniBanner.ts index 44bf3f9f4..a0df1102b 100644 --- a/test/features/MiniBanner.ts +++ b/test/features/MiniBanner.ts @@ -1,12 +1,10 @@ import { VueWrapper } from '@vue/test-utils'; import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates'; -import { expect, vi } from 'vitest'; +import { expect } from 'vitest'; const expectSlideShowPlaysWhenMiniBannerBecomesVisible = async ( wrapper: VueWrapper ): Promise => { await wrapper.setProps( { bannerState: BannerStates.Visible } ); - await vi.runOnlyPendingTimersAsync(); - expect( wrapper.find( '.wmde-banner-slider--playing' ).exists() ).toBeTruthy(); }; diff --git a/test/features/SetCookieImage.ts b/test/features/SetCookieImage.ts index fbed9832f..cdaf18c6f 100644 --- a/test/features/SetCookieImage.ts +++ b/test/features/SetCookieImage.ts @@ -1,54 +1,75 @@ import { VueWrapper } from '@vue/test-utils'; -import { expect, vi } from 'vitest'; +import { expect } from 'vitest'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; +import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; +import { Timer } from '@src/utils/Timer'; + +const expectSetsCookieImageOnSoftCloseClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); -const expectSetsCookieImageOnSoftCloseClose = async ( wrapper: VueWrapper ): Promise => { await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-close' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeTruthy(); }; -const expectSetsCookieImageOnSoftCloseTimeOut = async ( wrapper: VueWrapper ): Promise => { +const expectSetsCookieImageOnSoftCloseTimeOut = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { + const timer = new TimerSpy(); + const wrapper = getWrapper( null, timer ); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); - await vi.runAllTimersAsync(); + // The soft close counts down over 15 seconds so we need to keep advancing until it runs out + for ( let i: number = 0; i < 15; i++ ) { + await timer.advanceInterval(); + } expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeTruthy(); }; -const expectDoesNotSetCookieImageOnSoftCloseMaybeLater = async ( wrapper: VueWrapper ): Promise => { +const expectDoesNotSetCookieImageOnSoftCloseMaybeLater = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-maybe-later' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeFalsy(); }; -const expectSetCookieImageOnAlreadyDonatedMaybeLater = async ( wrapper: VueWrapper ): Promise => { +const expectSetCookieImageOnAlreadyDonatedMaybeLater = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-already-donated-button-maybe-later' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeTruthy(); }; -const expectSetAlreadyDonatedCookieImageOnAlreadyDonatedNoMoreBanners = async ( wrapper: VueWrapper ): Promise => { +const expectSetAlreadyDonatedCookieImageOnAlreadyDonatedNoMoreBanners = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-already-donated-button-go-away' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image-already-donated' ).exists() ).toBeTruthy(); }; -const expectSetCookieImageOnAlreadyDonatedLink = async ( wrapper: VueWrapper ): Promise => { +const expectSetCookieImageOnAlreadyDonatedLink = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-footer-already-donated' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image-already-donated' ).exists() ).toBeTruthy(); }; -const expectSetsMaybeLaterCookieOnSoftCloseMaybeLater = async ( wrapper: VueWrapper ): Promise => { +const expectSetsMaybeLaterCookieOnSoftCloseMaybeLater = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-maybe-later' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeFalsy(); }; -export const setCookieImageFeatures: Record ) => Promise> = { +export const setCookieImageFeatures: Record VueWrapper ) => Promise> = { expectSetsCookieImageOnSoftCloseClose, expectSetsCookieImageOnSoftCloseTimeOut, expectDoesNotSetCookieImageOnSoftCloseMaybeLater, diff --git a/test/features/SetCookieImageMobile.ts b/test/features/SetCookieImageMobile.ts index 9c5e82c06..cd737fa5e 100644 --- a/test/features/SetCookieImageMobile.ts +++ b/test/features/SetCookieImageMobile.ts @@ -1,33 +1,44 @@ import { VueWrapper } from '@vue/test-utils'; import { expect, vi } from 'vitest'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; +import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; +import { Timer } from '@src/utils/Timer'; + +const expectSetsCookieImageOnSoftCloseClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); -const expectSetsCookieImageOnSoftCloseClose = async ( wrapper: VueWrapper ): Promise => { await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-close' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeTruthy(); }; -const expectSetsCookieImageOnSoftCloseTimeOut = async ( wrapper: VueWrapper ): Promise => { - vi.useFakeTimers(); +const expectSetsCookieImageOnSoftCloseTimeOut = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { + const timer = new TimerSpy(); + const wrapper = getWrapper( null, timer ); await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); - await vi.runAllTimersAsync(); + // The soft close counts down over 15 seconds so we need to keep advancing until it runs out + for ( let i: number = 0; i < 15; i++ ) { + await timer.advanceInterval(); + } expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeTruthy(); vi.restoreAllMocks(); }; -const expectDoesNotSetCookieImageOnSoftCloseMaybeLater = async ( wrapper: VueWrapper ): Promise => { +const expectDoesNotSetCookieImageOnSoftCloseMaybeLater = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-maybe-later' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-set-cookie-image' ).exists() ).toBeFalsy(); }; -export const setCookieImageFeatures: Record ) => Promise> = { +export const setCookieImageFeatures: Record VueWrapper ) => Promise> = { expectSetsCookieImageOnSoftCloseClose, expectSetsCookieImageOnSoftCloseTimeOut, expectDoesNotSetCookieImageOnSoftCloseMaybeLater diff --git a/test/features/SoftCloseDesktop.ts b/test/features/SoftCloseDesktop.ts index 7cac2674d..5b4c63500 100644 --- a/test/features/SoftCloseDesktop.ts +++ b/test/features/SoftCloseDesktop.ts @@ -1,22 +1,31 @@ -import { expect, vi } from 'vitest'; +import { expect } from 'vitest'; import { VueWrapper } from '@vue/test-utils'; import { CloseChoices } from '@src/domain/CloseChoices'; import { CloseEvent } from '@src/tracking/events/CloseEvent'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; +import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; +import { Timer } from '@src/utils/Timer'; + +const expectShowsSoftClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); -const expectShowsSoftClose = async ( wrapper: VueWrapper ): Promise => { await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-soft-close' ).exists() ).toBeTruthy(); }; -const expectDoesNotShowSoftClose = async ( wrapper: VueWrapper ): Promise => { +const expectDoesNotShowSoftClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-soft-close' ).exists() ).toBeFalsy(); expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'MainBanner', CloseChoices.Close ) ); }; -const expectEmitsSoftCloseCloseEvent = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsSoftCloseCloseEvent = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-close' ).trigger( 'click' ); @@ -24,7 +33,9 @@ const expectEmitsSoftCloseCloseEvent = async ( wrapper: VueWrapper ): Promi expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.Close ) ); }; -const expectEmitsSoftCloseMaybeLaterEvent = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsSoftCloseMaybeLaterEvent = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-maybe-later' ).trigger( 'click' ); @@ -32,22 +43,32 @@ const expectEmitsSoftCloseMaybeLaterEvent = async ( wrapper: VueWrapper ): expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.MaybeLater ) ); }; -const expectEmitsSoftCloseTimeOutEvent = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsSoftCloseTimeOutEvent = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { + const timer = new TimerSpy(); + const wrapper = getWrapper( null, timer ); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); - await vi.runAllTimersAsync(); + // The soft close counts down over 15 seconds so we need to keep advancing until it runs out + for ( let i: number = 0; i < 15; i++ ) { + await timer.advanceInterval(); + } expect( wrapper.emitted( 'bannerClosed' ).length ).toBe( 1 ); expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.TimeOut ) ); }; -const expectEmitsBannerContentChangedOnSoftClose = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsBannerContentChangedOnSoftClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); expect( wrapper.emitted( 'bannerContentChanged' ).length ).toBe( 1 ); }; -const expectDoesNotShowSoftCloseOnFinalBannerImpression = async ( wrapper: VueWrapper ): Promise => { +const expectDoesNotShowSoftCloseOnFinalBannerImpression = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.setProps( { remainingImpressions: 0 } ); await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); @@ -56,13 +77,17 @@ const expectDoesNotShowSoftCloseOnFinalBannerImpression = async ( wrapper: VueWr expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'MainBanner', CloseChoices.Close ) ); }; -const expectShowsCloseIcon = async ( wrapper: VueWrapper ): Promise => { +const expectShowsCloseIcon = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-soft-close .wmde-banner-close' ).exists() ).toBeTruthy(); }; -const expectCloseIconEmitsCloseEvent = async ( wrapper: VueWrapper ): Promise => { +const expectCloseIconEmitsCloseEvent = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-close' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close .wmde-banner-close' ).trigger( 'click' ); @@ -71,7 +96,7 @@ const expectCloseIconEmitsCloseEvent = async ( wrapper: VueWrapper ): Promi expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.Close ) ); }; -export const softCloseFeatures: Record ) => Promise> = { +export const softCloseFeatures: Record VueWrapper ) => Promise> = { expectShowsSoftClose, expectEmitsSoftCloseCloseEvent, expectEmitsSoftCloseMaybeLaterEvent, diff --git a/test/features/SoftCloseMobile.ts b/test/features/SoftCloseMobile.ts index e2df42034..03be8c0f7 100644 --- a/test/features/SoftCloseMobile.ts +++ b/test/features/SoftCloseMobile.ts @@ -1,9 +1,14 @@ -import { expect, vi } from 'vitest'; +import { expect } from 'vitest'; import { VueWrapper } from '@vue/test-utils'; import { CloseChoices } from '@src/domain/CloseChoices'; import { CloseEvent } from '@src/tracking/events/CloseEvent'; +import { TimerSpy } from '@test/fixtures/TimerSpy'; +import { Timer } from '@src/utils/Timer'; +import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent'; + +const expectShowsSoftCloseOnMiniBannerClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); -const expectShowsSoftCloseOnMiniBannerClose = async ( wrapper: VueWrapper ): Promise => { await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); expect( wrapper.classes() ).toContain( 'wmde-banner-wrapper--soft-closing' ); @@ -11,14 +16,18 @@ const expectShowsSoftCloseOnMiniBannerClose = async ( wrapper: VueWrapper ) expect( wrapper.emitted( 'bannerContentChanged' ).length ).toBe( 1 ); }; -const expectDoesNotShowSoftCloseOnFullBannerClose = async ( wrapper: VueWrapper ): Promise => { +const expectDoesNotShowSoftCloseOnFullBannerClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-mini-button' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-full-close' ).trigger( 'click' ); expect( wrapper.find( '.wmde-banner-soft-close' ).exists() ).toBeFalsy(); }; -const expectEmitsSoftCloseCloseEvent = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsSoftCloseCloseEvent = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-close' ).trigger( 'click' ); @@ -26,7 +35,9 @@ const expectEmitsSoftCloseCloseEvent = async ( wrapper: VueWrapper ): Promi expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.Close ) ); }; -const expectEmitsSoftCloseMaybeLaterEvent = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsSoftCloseMaybeLaterEvent = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-maybe-later' ).trigger( 'click' ); @@ -34,7 +45,9 @@ const expectEmitsSoftCloseMaybeLaterEvent = async ( wrapper: VueWrapper ): expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.MaybeLater ) ); }; -const expectEmitsSoftCloseAlreadyDonatedEvent = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsSoftCloseAlreadyDonatedEvent = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); await wrapper.find( '.wmde-banner-soft-close-button-already-donated' ).trigger( 'click' ); @@ -42,22 +55,32 @@ const expectEmitsSoftCloseAlreadyDonatedEvent = async ( wrapper: VueWrapper expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.AlreadyDonated ) ); }; -const expectEmitsSoftCloseTimeOutEvent = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsSoftCloseTimeOutEvent = async ( getWrapper: ( dynamicContent: DynamicContent, timer: Timer ) => VueWrapper ): Promise => { + const timer = new TimerSpy(); + const wrapper = getWrapper( null, timer ); + await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); - await vi.runAllTimersAsync(); + // The soft close counts down over 15 seconds so we need to keep advancing until it runs out + for ( let i: number = 0; i < 15; i++ ) { + await timer.advanceInterval(); + } expect( wrapper.emitted( 'bannerClosed' ).length ).toBe( 1 ); expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'SoftClose', CloseChoices.TimeOut ) ); }; -const expectEmitsBannerContentChangedOnSoftClose = async ( wrapper: VueWrapper ): Promise => { +const expectEmitsBannerContentChangedOnSoftClose = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); expect( wrapper.emitted( 'bannerContentChanged' ).length ).toBe( 1 ); }; -const expectDoesNotShowSoftCloseOnFinalBannerImpression = async ( wrapper: VueWrapper ): Promise => { +const expectDoesNotShowSoftCloseOnFinalBannerImpression = async ( getWrapper: () => VueWrapper ): Promise => { + const wrapper = getWrapper(); + await wrapper.setProps( { remainingImpressions: 0 } ); await wrapper.find( '.wmde-banner-mini-close-button' ).trigger( 'click' ); @@ -66,7 +89,7 @@ const expectDoesNotShowSoftCloseOnFinalBannerImpression = async ( wrapper: VueWr expect( wrapper.emitted( 'bannerClosed' )[ 0 ][ 0 ] ).toEqual( new CloseEvent( 'MainBanner', CloseChoices.Close ) ); }; -export const softCloseFeatures: Record ) => Promise> = { +export const softCloseFeatures: Record VueWrapper ) => Promise> = { expectShowsSoftCloseOnMiniBannerClose, expectDoesNotShowSoftCloseOnFullBannerClose, expectEmitsSoftCloseCloseEvent, diff --git a/test/fixtures/TimerSpy.ts b/test/fixtures/TimerSpy.ts new file mode 100644 index 000000000..1a8bb858b --- /dev/null +++ b/test/fixtures/TimerSpy.ts @@ -0,0 +1,47 @@ +import { Timer } from '@src/utils/Timer'; +import { nextTick } from 'vue'; + +export class TimerSpy implements Timer { + public clearAllCalls: number = 0; + public clearIntervalIds: number[] = []; + public clearTimeoutIds: number[] = []; + public nextTickCalls: number = 0; + public setIntervalCalls: number[] = []; + public setTimeoutCalls: number[] = []; + + private _interval: () => void; + + public clearAll(): void { + this.clearAllCalls++; + } + + public clearInterval( id: number ): void { + this.clearIntervalIds.push( id ); + } + + public clearTimeout( id: number ): void { + this.clearTimeoutIds.push( id ); + } + + public nextTick( fn: () => void ): void { + this.nextTickCalls++; + fn(); + } + + public setInterval( fn: () => void, after: number ): number { + this.setIntervalCalls.push( after ); + this._interval = fn; + return 0; + } + + public setTimeout( fn: () => void, after: number ): number { + this.setTimeoutCalls.push( after ); + fn(); + return 0; + } + + public async advanceInterval(): Promise { + this._interval(); + return await nextTick(); + } +} diff --git a/test/fixtures/TimerStub.ts b/test/fixtures/TimerStub.ts new file mode 100644 index 000000000..31dfea903 --- /dev/null +++ b/test/fixtures/TimerStub.ts @@ -0,0 +1,26 @@ +import { Timer } from '@src/utils/Timer'; + +export class TimerStub implements Timer { + public clearAll(): void { + } + + public clearInterval(): void { + } + + public clearTimeout(): void { + } + + public setInterval( fn: () => void ): number { + fn(); + return 0; + } + + public setTimeout( fn: () => void ): number { + fn(); + return 0; + } + + public nextTick( fn: () => void ): void { + fn(); + } +} From 8127a6c1dcc219e361905971e87fed0ba10426ef Mon Sep 17 00:00:00 2001 From: Abban Dunne Date: Fri, 8 Nov 2024 06:50:24 +0100 Subject: [PATCH 2/2] Remove import comments in entry points We previously tried to separate the imports in the banner entry points into logical sections. This didn't work well with IDE auto adding them at the bottom each time a new object was added. It was also a little confusing as to what should go where. This removes the comments and embraces js import chaos. Ticket: https://phabricator.wikimedia.org/T378589 --- banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts | 4 ---- banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts | 4 ---- banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts | 4 ---- banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts | 4 ---- banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts | 4 ---- banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts | 4 ---- banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts | 4 ---- banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts | 4 ---- banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts | 4 ---- banners/pad/C24_WMDE_iPad_00/banner_var.ts | 4 ---- banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts | 4 ---- banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts | 4 ---- banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts | 4 ---- banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts | 4 ---- banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts | 4 ---- banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts | 4 ---- banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts | 4 ---- banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts | 4 ---- banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts | 4 ---- banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts | 4 ---- 62 files changed, 248 deletions(-) diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts index 0dfc062a4..157314205 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts index 3567169ad..73c0d83df 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts index 732e91cc5..8815d8ff8 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts index 45f0d1776..ea8aa628e 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_01/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts index 0dfc062a4..157314205 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts index f1429c40a..790f5e4c4 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_02/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { currentCampaignTimePercentage } from './currentCampaignTimePercentage'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts index bda6ddc01..6e6f9870f 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts index a979c6fea..b69418994 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_03/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts index dd81a0301..cb264ec02 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts index b298041c4..d67574189 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_04/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts index 484d71792..510434589 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts index 0c599541c..9ccbc34d5 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_05/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts index 484d71792..510434589 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts index ee992cc6a..50c379d37 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_06/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { createFAQPageURL } from '@src/createFAQPageURL'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts index 484d71792..510434589 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_ctrl.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts index 0b02e0d9d..efc3e2a79 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_07/banner_var.ts @@ -18,12 +18,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts index 2be3e1dd8..c0b50d8ba 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_ctrl.ts @@ -19,12 +19,8 @@ import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts index f1f6d755c..e45ec70f5 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_08/banner_var.ts @@ -19,12 +19,8 @@ import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; - -// Locale-specific imports import messages from './messages_var'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts index 2be3e1dd8..c0b50d8ba 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_ctrl.ts @@ -19,12 +19,8 @@ import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts index 85fc66680..539890a80 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_09/banner_var.ts @@ -19,12 +19,8 @@ import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts index 2be3e1dd8..c0b50d8ba 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_ctrl.ts @@ -19,12 +19,8 @@ import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts index 784a4c1be..754f31a78 100644 --- a/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts +++ b/banners/desktop/C24_WMDE_Desktop_DE_10/banner_var.ts @@ -19,12 +19,8 @@ import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; import { createFallbackDonationURL } from '@src/createFallbackDonationURL'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items_var'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts index 356e51c58..5ac47a488 100644 --- a/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_00/banner_ctrl.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts index 72b570412..3ea0eb145 100644 --- a/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_00/banner_var.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts index 07b0436c4..1e244476a 100644 --- a/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_01/banner_ctrl.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts index f56ac5fae..9dd0bb243 100644 --- a/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_01/banner_var.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts index 07b0436c4..1e244476a 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02/banner_ctrl.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts index fa370094b..f655c9fb7 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02/banner_var.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts index 07b0436c4..1e244476a 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02b/banner_ctrl.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts index fa370094b..f655c9fb7 100644 --- a/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_02b/banner_var.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts b/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts index dc7dc1995..eaa6e8e8e 100644 --- a/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts +++ b/banners/english/C24_WMDE_Desktop_EN_03/banner_ctrl.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map'; diff --git a/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts b/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts index 61395bfb6..2c68c8e80 100644 --- a/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts +++ b/banners/english/C24_WMDE_Desktop_EN_03/banner_var.ts @@ -17,12 +17,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import { Locales } from '@src/domain/Locales'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import eventMappings from './event_map_var'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts index df6ec60fb..c472f3ba3 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_ctrl.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts index da38ca6d8..9d7181931 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_00/banner_var.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items_var'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts index df6ec60fb..c472f3ba3 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_ctrl.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts index 52609ee9b..b6647dd3a 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_01/banner_var.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts index df6ec60fb..c472f3ba3 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_ctrl.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts index 0f99acfa9..6157e6425 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_02/banner_var.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts index df6ec60fb..c472f3ba3 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_ctrl.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts index 183230fea..ba042d074 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_03/banner_var.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts index 4fcea4f91..df06730ea 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_ctrl.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts index 2248b371f..3de1a8053 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_04/banner_var.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts index 4fcea4f91..df06730ea 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_ctrl.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts index 7f3cc6c61..165b8e8a6 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_05/banner_var.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts index 01de2c240..9bd77f7f5 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_ctrl.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; diff --git a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts index ef4976725..936510cea 100644 --- a/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts +++ b/banners/mobile/C24_WMDE_Mobile_DE_06/banner_var.ts @@ -17,12 +17,8 @@ import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG'; import eventMappings from './event_map'; - -// Locale-specific imports import messages from './messages_var'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; import { LocalStorageCloseTracker } from '@src/utils/LocalCloseTracker'; diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts index 05554ca7a..2d6f715db 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_ctrl.ts @@ -18,12 +18,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { Locales } from '@src/domain/Locales'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts index 42da644e5..a7998c2e8 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_00/banner_var.ts @@ -18,12 +18,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { Locales } from '@src/domain/Locales'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts index 05554ca7a..2d6f715db 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_ctrl.ts @@ -18,12 +18,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { Locales } from '@src/domain/Locales'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts index aef6ea997..c939a790b 100644 --- a/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts +++ b/banners/mobile_english/C24_WMDE_Mobile_EN_01/banner_var.ts @@ -18,12 +18,8 @@ import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; import { WindowPageScroller } from '@src/utils/PageScroller/WindowPageScroller'; import { Locales } from '@src/domain/Locales'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content for EN banners import messages from './messages'; import { LocaleFactoryEn } from '@src/utils/LocaleFactory/LocaleFactoryEn'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts b/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts index e81d1b159..07cefb7e4 100644 --- a/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts +++ b/banners/pad/C24_WMDE_iPad_00/banner_ctrl.ts @@ -16,12 +16,8 @@ import eventMappings from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/pad/C24_WMDE_iPad_00/banner_var.ts b/banners/pad/C24_WMDE_iPad_00/banner_var.ts index df58c9b8b..f353ab4fa 100644 --- a/banners/pad/C24_WMDE_iPad_00/banner_var.ts +++ b/banners/pad/C24_WMDE_iPad_00/banner_var.ts @@ -16,12 +16,8 @@ import eventMappings from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items_var'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts b/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts index e81d1b159..07cefb7e4 100644 --- a/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts +++ b/banners/pad/C24_WMDE_iPad_DE_01/banner_ctrl.ts @@ -16,12 +16,8 @@ import eventMappings from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts b/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts index 038458957..8ec6cc011 100644 --- a/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts +++ b/banners/pad/C24_WMDE_iPad_DE_01/banner_var.ts @@ -16,12 +16,8 @@ import eventMappings from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items_var'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts index e91454f4d..96bcddea3 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_ctrl.ts @@ -13,12 +13,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts index 03a022150..3d0c63abf 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_00/banner_var.ts @@ -13,12 +13,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts index e91454f4d..96bcddea3 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_ctrl.ts @@ -13,12 +13,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts index 03a022150..3d0c63abf 100644 --- a/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts +++ b/banners/wpde_desktop/C24_WPDE_Desktop_01/banner_var.ts @@ -13,12 +13,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts index 80721fb97..83243b966 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_ctrl.ts @@ -14,12 +14,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts index 18ab49b42..d3c852064 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_00/banner_var.ts @@ -14,12 +14,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts index 80721fb97..83243b966 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_ctrl.ts @@ -14,12 +14,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer'; diff --git a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts index 18ab49b42..d3c852064 100644 --- a/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts +++ b/banners/wpde_mobile/C24_WPDE_Mobile_01/banner_var.ts @@ -14,12 +14,8 @@ import eventMap from './event_map'; import { Translator } from '@src/Translator'; import DynamicTextPlugin from '@src/DynamicTextPlugin'; import { LocalImpressionCount } from '@src/utils/LocalImpressionCount'; - -// Channel specific form setup import { createFormItems } from './form_items'; import { createFormActions } from '@src/createFormActions'; - -// Content import messages from './messages'; import { LocaleFactoryWpDe } from '@src/utils/LocaleFactory/LocaleFactoryWpDe'; import { WindowTimer } from '@src/utils/Timer';