Skip to content

Commit 8085d1c

Browse files
committed
Add test to ArticlePage
1 parent 1e25986 commit 8085d1c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

dotcom-rendering/src/components/ArticlePage.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { DecideLayout } from '../layouts/DecideLayout';
44
import { buildAdTargeting } from '../lib/ad-targeting';
55
import { ArticleDesign } from '../lib/articleFormat';
66
import { rootStyles } from '../lib/rootStyles';
7+
import { useBetaAB } from '../lib/useAB';
78
import { filterABTestSwitches } from '../model/enhance-switches';
89
import type { NavType } from '../model/extract-nav';
910
import type { Article } from '../types/article';
@@ -23,7 +24,6 @@ import { SendTargetingParams } from './SendTargetingParams.importable';
2324
import { SetABTests } from './SetABTests.importable';
2425
import { SetAdTargeting } from './SetAdTargeting.importable';
2526
import { SkipTo } from './SkipTo';
26-
import { SomeComponent } from './SomeComponent';
2727

2828
interface BaseProps {
2929
article: Article;
@@ -67,9 +67,21 @@ export const ArticlePage = (props: WebProps | AppProps) => {
6767
theme,
6868
};
6969

70+
const abTests = useBetaAB();
71+
72+
const isInVariantGroup =
73+
abTests?.isUserInTestGroup(
74+
'commercial-testing-beta-ab-test',
75+
'variant',
76+
) ?? false;
77+
7078
return (
7179
<StrictMode>
72-
<SomeComponent />
80+
{isInVariantGroup ? (
81+
<h1>This is an AB test</h1>
82+
) : (
83+
<h1>Not in test</h1>
84+
)}
7385
<Global styles={rootStyles(format, darkModeAvailable)} />
7486
{isWeb && (
7587
<>

0 commit comments

Comments
 (0)