Skip to content

Commit 71b74b1

Browse files
committed
Remove test from old framework and replace with new. Start test.
1 parent 18e5450 commit 71b74b1

File tree

5 files changed

+24
-42
lines changed

5 files changed

+24
-42
lines changed

ab-testing/config/abTests.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ const ABTests: ABTest[] = [
5858
groups: ["control", "variant"],
5959
shouldForceMetricsCollection: true,
6060
},
61+
{
62+
name: "fronts-and-curation-onward-journeys",
63+
description: "Testing the new Onward Journey component on all articles",
64+
owners: ["[email protected]"],
65+
expirationDate: `2026-02-25`,
66+
type: "client",
67+
status: "ON",
68+
audienceSize: 50 / 100,
69+
audienceSpace: "A",
70+
groups: ["control", "variant"],
71+
shouldForceMetricsCollection: false,
72+
},
6173
];
6274

6375
const activeABtests = ABTests.filter((test) => test.status === "ON");

ab-testing/config/types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type AudienceSpace = Map<string, FastlyTestParams>;
44

55
type AllSpace = Map<string, FastlyTestParams[]>;
66

7-
type Team = "commercial" | "webex" | "thefilter";
7+
type Team = "commercial" | "webex" | "thefilter" | "fronts-and-curation";
88

99
type TestName = `${Team}-${string}`;
1010

@@ -23,7 +23,8 @@ type ABTest = {
2323
expirationDate: `${Year}-${Month}-${Day}`;
2424
/** Test type: should this run on the server or client */
2525
type: "server" | "client";
26-
/** Whether the AB test is currently running or not
26+
/**
27+
* Whether the AB test is currently running or not
2728
* Would be nice to know who changed the status last and when
2829
*/
2930
status: "ON" | "OFF";
@@ -37,7 +38,8 @@ type ABTest = {
3738
audienceSpace?: "A" | "B" | "C";
3839
/** Test group definition */
3940
groups: string[];
40-
/** Bypasses sampling to force metrics collection for this test
41+
/**
42+
* Bypasses sampling to force metrics collection for this test
4143
* See DCR Metrics component for end usage
4244
*/
4345
shouldForceMetricsCollection?: boolean;

dotcom-rendering/src/components/OnwardsUpper.importable.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Pillar,
88
} from '../lib/articleFormat';
99
import type { EditionId } from '../lib/edition';
10-
import { useAB } from '../lib/useAB';
10+
import { useBetaAB } from '../lib/useAB';
1111
import { useIsHorizontalScrollingSupported } from '../lib/useIsHorizontalScrollingSupported';
1212
import { palette } from '../palette';
1313
import type { OnwardsSource } from '../types/onwards';
@@ -227,10 +227,13 @@ export const OnwardsUpper = ({
227227
webURL,
228228
isInStarRatingVariant,
229229
}: Props) => {
230-
const abTestAPI = useAB()?.api;
230+
const abTests = useBetaAB();
231231
const isInOnwardsAbTestVariant =
232232
renderingTarget === 'Web' &&
233-
abTestAPI?.isUserInVariant('OnwardJourneys', 'variant');
233+
abTests?.isUserInTestGroup(
234+
'fronts-and-curation-onward-journeys',
235+
'variant',
236+
);
234237

235238
const isHorizontalScrollingSupported = useIsHorizontalScrollingSupported();
236239
if (!isHorizontalScrollingSupported) return null;
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import type { ABTest } from '@guardian/ab-core';
22
import { abTestTest } from './tests/ab-test-test';
33
import { noAuxiaSignInGate } from './tests/no-auxia-sign-in-gate';
4-
import { onwardJourneys } from './tests/onward-journeys';
54
import { userBenefitsApi } from './tests/user-benefits-api';
65

76
// keep in sync with ab-tests in frontend
87
// https://github.com/guardian/frontend/tree/main/static/src/javascripts/projects/common/modules/experiments/ab-tests.ts
9-
export const tests: ABTest[] = [
10-
abTestTest,
11-
userBenefitsApi,
12-
noAuxiaSignInGate,
13-
onwardJourneys,
14-
];
8+
export const tests: ABTest[] = [abTestTest, userBenefitsApi, noAuxiaSignInGate];

dotcom-rendering/src/experiments/tests/onward-journeys.ts

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

0 commit comments

Comments
 (0)