Skip to content

Commit

Permalink
feat: check for newsPaperArchive v1 ,v2 ,control only tests on checko…
Browse files Browse the repository at this point in the history
…ut and thankyou
  • Loading branch information
paul-daniel-dempsey committed Oct 25, 2024
1 parent f3e65ca commit 3fbf0c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion support-frontend/assets/pages/[countryGroupId]/checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,13 @@ function CheckoutComponent({
const abParticipations = abTestInit({ countryId, countryGroupId });
const supportAbTests = getSupportAbTests(abParticipations);

const productDescription = abParticipations.newspaperArchiveBenefit
/* display if either:-
ab-newspaperArchiveBenefit.isActive = true
url contains '#ab-newspaperArchiveBenefit=v1/v2/control' for testing purposes
*/
const productDescription = ['v1', 'v2', 'control'].includes(
abParticipations.newspaperArchiveBenefit ?? '',
)
? productCatalogDescriptionNewBenefits[productKey]
: productCatalogDescription[productKey];
const ratePlanDescription = productDescription.ratePlans[ratePlanKey];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,14 @@ export function ThankYouComponent({

/* display if either:-
ab-newspaperArchiveBenefit.isActive = true
url contains '#ab-newspaperArchiveBenefit' for testing purposes
url contains '#ab-newspaperArchiveBenefit=v1/v2/control' for testing purposes
*/
const showNewspaperArchiveBenefit =
typeof abTestInit({
const showNewspaperArchiveBenefit = ['v1', 'v2', 'control'].includes(
abTestInit({
countryId,
countryGroupId,
}).newspaperArchiveBenefit === 'string';
}).newspaperArchiveBenefit ?? '',
);

const thankYouModuleData = getThankYouModuleData(
countryId,
Expand Down

0 comments on commit 3fbf0c9

Please sign in to comment.