FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ES6 convert acquisitions epic tests (#17583) · devhttps/frontend@e25f00c · GitHub

Commit e25f00c

Browse files
authored andcommitted
ES6 convert acquisitions epic tests (guardian#17583)
1 parent 33ba260 commit e25f00c

17 files changed

Lines changed: 299 additions & 309 deletions

‎dev/flow-typed-guardian-frontend/ab-tests.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ declare type ABTest = {
3232

3333
declare type ContributionsABTest = ABTest & {
3434
epic: boolean,
35+
componentType: OphanComponentType,
3536
campaignId: string,
3637
campaignPrefix: string,
3738
campaignSuffix: string,
@@ -67,6 +68,7 @@ declare type InitContributionsABTest = {
6768
variants: InitContributionsABTestVariant[],
6869

6970
epic?: boolean,
71+
componentType?: OphanComponentType,
7072
// locations is a filter where empty is taken to mean 'all'
7173
locations?: string[],
7274
locationCheck?: () => boolean,

‎dev/flow-typed-guardian-frontend/ophan.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ declare type OphanComponentType =
4343
| 'NEWSLETTER_SUBSCRIPTION'
4444
| 'SURVEYS_QUESTIONS'
4545
| 'ACQUISITIONS_EPIC'
46-
| 'ACQUISITIONS_ENGAGEMENT_BANNER';
46+
| 'ACQUISITIONS_ENGAGEMENT_BANNER'
47+
| 'THANK_YOU_EPIC';
4748

4849
declare type OphanComponent = {|
4950
type: OphanComponentType,

‎static/src/javascripts-legacy/projects/common/modules/experiments/tests/acquisitions-epic-always-ask-election.js‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

‎static/src/javascripts-legacy/projects/common/modules/experiments/tests/acquisitions-epic-always-ask-if-tagged.js‎

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎static/src/javascripts-legacy/projects/common/modules/experiments/tests/acquisitions-epic-election-interactive-end.js‎

Lines changed: 0 additions & 72 deletions
This file was deleted.

‎static/src/javascripts-legacy/projects/common/modules/experiments/tests/acquisitions-epic-election-interactive-slice.js‎

Lines changed: 0 additions & 66 deletions
This file was deleted.

‎static/src/javascripts-legacy/projects/common/modules/experiments/tests/acquisitions-epic-thank-you.js‎

Lines changed: 0 additions & 78 deletions
This file was deleted.

‎static/src/javascripts/projects/common/modules/commercial/acquisitions-ophan.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ const submitComponentEvent = (componentEvent: OphanComponentEvent) => {
77

88
export const submitEpicInsertEvent = (
99
products: OphanProduct[],
10-
campaignCode: string
10+
campaignCode: string,
11+
type: OphanComponentType = 'ACQUISITIONS_EPIC'
1112
) => {
1213
submitComponentEvent({
1314
component: {
14-
type: 'ACQUISITIONS_EPIC',
15+
type,
1516
labels: [],
1617
products,
1718
campaignCode,
@@ -22,11 +23,12 @@ export const submitEpicInsertEvent = (
2223

2324
export const submitEpicViewEvent = (
2425
products: OphanProduct[],
25-
campaignCode: string
26+
campaignCode: string,
27+
type: OphanComponentType = 'ACQUISITIONS_EPIC'
2628
) => {
2729
submitComponentEvent({
2830
component: {
29-
type: 'ACQUISITIONS_EPIC',
31+
type,
3032
labels: [],
3133
products,
3234
campaignCode,

‎static/src/javascripts/projects/common/modules/commercial/contributions-utilities.js‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,20 @@ const makeABTestVariant = (
220220
test = noop,
221221
impression = submitABTestImpression =>
222222
mediator.once(parentTest.insertEvent, () => {
223-
submitEpicInsertEvent(products, campaignCode);
223+
submitEpicInsertEvent(
224+
products,
225+
campaignCode,
226+
parentTest.componentType
227+
);
224228
submitABTestImpression();
225229
}),
226230
success = submitABTestComplete =>
227231
mediator.once(parentTest.viewEvent, () => {
228-
submitEpicViewEvent(products, campaignCode);
232+
submitEpicViewEvent(
233+
products,
234+
campaignCode,
235+
parentTest.componentType
236+
);
229237
submitABTestComplete();
230238
}),
231239
} = options;
@@ -364,6 +372,7 @@ const makeABTest = ({
364372

365373
// optional params
366374
epic = true,
375+
componentType = 'ACQUISITIONS_EPIC',
367376
// locations is a filter where empty is taken to mean 'all'
368377
locations = [],
369378
locationCheck = () => true,
@@ -410,6 +419,7 @@ const makeABTest = ({
410419
dataLinkNames,
411420
isEngagementBannerTest,
412421
epic,
422+
componentType,
413423
campaignId,
414424
campaignPrefix,
415425
campaignSuffix,

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL