Skip to content

Commit 41ba735

Browse files
committed
Merge remote-tracking branch 'origin/main' into jlk/warn-on-expired-test
2 parents b785996 + 6d29731 commit 41ba735

File tree

143 files changed

+4976
-2349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4976
-2349
lines changed

ab-testing/config/abTests.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const ABTests: ABTest[] = [
2424
name: "commercial-prebid-v10",
2525
description: "Testing Prebid.js v10 integration on DCR",
2626
owners: ["[email protected]"],
27-
status: "OFF",
28-
expirationDate: "2025-12-10",
27+
status: "ON",
28+
expirationDate: "2026-01-10",
2929
type: "client",
3030
audienceSize: 10 / 100,
3131
audienceSpace: "A",
@@ -37,26 +37,14 @@ const ABTests: ABTest[] = [
3737
description:
3838
"Tests whether we can get the users email, hash it and pass pd value to the userId array",
3939
owners: ["[email protected]"],
40-
expirationDate: `2025-12-19`,
40+
expirationDate: `2026-01-15`,
4141
type: "client",
42-
status: "ON",
42+
status: "OFF",
4343
audienceSize: 10 / 100,
4444
audienceSpace: "A",
4545
groups: ["control", "variant"],
4646
shouldForceMetricsCollection: true,
4747
},
48-
{
49-
name: "thefilter-product-element",
50-
description:
51-
"A hold back test to measure uplift of the product element",
52-
owners: ["[email protected]"],
53-
status: "ON",
54-
expirationDate: "2025-12-30",
55-
type: "server",
56-
audienceSize: 40 / 100,
57-
groups: ["control", "variant"],
58-
shouldForceMetricsCollection: false,
59-
},
6048
{
6149
name: "commercial-user-module-uid2",
6250
description:

dotcom-rendering/.storybook/preview.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ import { Picture } from '../src/components/Picture';
1212
import { mockFetch } from '../src/lib/mockRESTCalls';
1313
import { setABTests } from '../src/lib/useAB';
1414
import { ConfigContextDecorator } from './decorators/configContextDecorator';
15+
import { sb } from 'storybook/test';
1516
import { Preview } from '@storybook/react-webpack5';
1617
import {
1718
globalColourScheme,
1819
globalColourSchemeDecorator,
1920
} from './toolbar/globalColourScheme';
2021
import { palette as sourcePalette } from '@guardian/source/foundations';
2122

23+
// Set up module mocking for auth and newsletter subscription hooks
24+
sb.mock(import('../src/lib/useNewsletterSubscription.ts'), { spy: true });
25+
sb.mock(import('../src/lib/useAuthStatus.ts'), { spy: true });
26+
sb.mock(import('../src/lib/fetchEmail.ts'), { spy: true });
27+
2228
// Prevent components being lazy rendered when we're taking Chromatic snapshots
2329
Lazy.disabled = isChromatic();
2430
Picture.disableLazyLoading = isChromatic();
@@ -64,6 +70,7 @@ style.appendChild(document.createTextNode(css));
6470
},
6571
page: {
6672
ajaxUrl: 'https://api.nextgen.guardianapps.co.uk',
73+
idApiUrl: 'https://idapi.theguardian.com',
6774
},
6875
tests: {},
6976
switches: {},

dotcom-rendering/docs/development/ab-testing-in-dcr.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,20 @@ These links are also in the [frontend admin](https://frontend.gutools.co.uk/anal
255255
- Opt-out on PROD: `https://theguardian.com/ab-tests/opt/out`
256256

257257
You can use the same routes on CODE.
258+
259+
### 6. Forcing yourself into a test locally
260+
261+
Use the opt-in and opt-out URL fragments to force yourself into or out of a test using a query parameter.
262+
263+
When opted-in, the test will override any mvt based assignment and you'll only be in the opted-in test group.
264+
265+
**Opt-in Example**
266+
267+
- Articles: `http://localhost:3030/Article/?ab-commercial-test-example=variant`
268+
- Fronts: `http://localhost:3030/Front/https://www.theguardian.com/international?ab-commercial-test-example=variant`
269+
- Interactives: `http://localhost:3030/Interactive/https://www.theguardian.com/global-development/ng-interactive/2022/jun/09/the-black-sea-blockade-mapping-the-impact-of-war-in-ukraine-on-the-worlds-food-supply-interactive?ab--commercial-test-example=variant`
270+
271+
You can verify that you're in the test by checking:
272+
273+
- Server-side tests: `window.guardian.config.serverSideABTests` in the browser console
274+
- Client-side tests: `window.guardian.modules.abTests.getParticipations()` in the browser console

dotcom-rendering/fixtures/generated/match-report.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export const matchReport: MatchReportType = {
274274
shotsOff: 6,
275275
corners: 10,
276276
fouls: 4,
277-
colours: '#ffffff',
277+
colours: '#01009a',
278278
crest: 'https://sport.guim.co.uk/football/crests/120/7699.png',
279279
},
280280
awayTeam: {
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
import { type FootballTable } from '../../src/footballTables';
2+
3+
export const table: FootballTable = {
4+
entries: [
5+
{
6+
position: 1,
7+
team: {
8+
name: 'Liverpool',
9+
id: '9',
10+
url: '/football/liverpool',
11+
},
12+
gamesPlayed: 29,
13+
won: 21,
14+
drawn: 7,
15+
lost: 1,
16+
goalsFor: 69,
17+
goalsAgainst: 27,
18+
goalDifference: 42,
19+
points: 70,
20+
results: [
21+
{
22+
matchId: '1',
23+
self: { name: 'Liverpool', score: 1 },
24+
foe: { name: 'Chelsea', score: 0 },
25+
},
26+
{
27+
matchId: '2',
28+
self: { name: 'Liverpool', score: 3 },
29+
foe: { name: 'Arsenal', score: 5 },
30+
},
31+
{
32+
matchId: '3',
33+
self: { name: 'Liverpool', score: 0 },
34+
foe: { name: 'West Ham', score: 0 },
35+
},
36+
{
37+
matchId: '4',
38+
self: { name: 'Liverpool', score: 8 },
39+
foe: { name: 'Tottenham', score: 10 },
40+
},
41+
{
42+
matchId: '5',
43+
self: { name: 'Liverpool', score: 0 },
44+
foe: { name: 'Brighton', score: 0 },
45+
},
46+
],
47+
},
48+
{
49+
position: 2,
50+
team: {
51+
name: 'Arsenal',
52+
id: '1006',
53+
url: '/football/arsenal',
54+
},
55+
gamesPlayed: 29,
56+
won: 21,
57+
drawn: 10,
58+
lost: 3,
59+
goalsFor: 53,
60+
goalsAgainst: 24,
61+
goalDifference: 29,
62+
points: 58,
63+
results: [
64+
{
65+
matchId: '1',
66+
self: { name: 'Arsenal', score: 4 },
67+
foe: { name: 'Brighton', score: 0 },
68+
},
69+
{
70+
matchId: '2',
71+
self: { name: 'Arsenal', score: 3 },
72+
foe: {
73+
name: 'Manchester United',
74+
score: 0,
75+
},
76+
},
77+
{
78+
matchId: '3',
79+
self: { name: 'Arsenal', score: 5 },
80+
foe: { name: 'West Ham', score: 0 },
81+
},
82+
{
83+
matchId: '4',
84+
self: { name: 'Arsenal', score: 9 },
85+
foe: {
86+
name: 'Manchester City',
87+
score: 0,
88+
},
89+
},
90+
{
91+
matchId: '5',
92+
self: { name: 'Arsenal', score: 0 },
93+
foe: { name: 'Tottenham', score: 0 },
94+
},
95+
],
96+
},
97+
{
98+
position: 3,
99+
team: {
100+
name: 'Nottm Forest',
101+
id: '15',
102+
url: '/football/nottinghamforest',
103+
},
104+
gamesPlayed: 29,
105+
won: 16,
106+
drawn: 6,
107+
lost: 7,
108+
goalsFor: 49,
109+
goalsAgainst: 35,
110+
goalDifference: 14,
111+
points: 54,
112+
results: [
113+
{
114+
matchId: '1',
115+
self: { name: 'Nottm Forest', score: 4 },
116+
foe: { name: 'Brighton', score: 4 },
117+
},
118+
{
119+
matchId: '2',
120+
self: { name: 'Nottm Forest', score: 0 },
121+
foe: {
122+
name: 'Manchester United',
123+
score: 0,
124+
},
125+
},
126+
{
127+
matchId: '3',
128+
self: { name: 'Nottm Forest', score: 0 },
129+
foe: { name: 'West Ham', score: 7 },
130+
},
131+
{
132+
matchId: '4',
133+
self: { name: 'Nottm Forest', score: 9 },
134+
foe: {
135+
name: 'Manchester City',
136+
score: 0,
137+
},
138+
},
139+
{
140+
matchId: '5',
141+
self: { name: 'Nottm Forest', score: 10 },
142+
foe: { name: 'Tottenham', score: 0 },
143+
},
144+
],
145+
},
146+
],
147+
};

0 commit comments

Comments
 (0)