Skip to content

Commit 22fed44

Browse files
committed
variant -> variation
1 parent 7240cb4 commit 22fed44

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

src/app/components/Recommendations/index.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('Recommendations', () => {
6363
<Recommendations
6464
data={[]}
6565
topStoriesContent={topStoriesContentFixture}
66-
referrerVariant="adaptive_variant"
66+
referrerVariant="adaptive_variation"
6767
referrer="direct"
6868
/>,
6969
{
@@ -107,7 +107,7 @@ describe('Recommendations', () => {
107107
<Recommendations
108108
data={[]}
109109
featuresContent={featuresContentFixture}
110-
referrerVariant="adaptive_variant"
110+
referrerVariant="adaptive_variation"
111111
referrer="social"
112112
/>,
113113
{
@@ -151,7 +151,7 @@ describe('Recommendations', () => {
151151
<Recommendations
152152
data={[]}
153153
blocks={relatedContentBlocksFixture}
154-
referrerVariant="adaptive_variant"
154+
referrerVariant="adaptive_variation"
155155
referrer="search"
156156
/>,
157157
{
@@ -216,7 +216,7 @@ describe('Recommendations', () => {
216216
<Recommendations
217217
data={[]}
218218
blocks={singleRelatedContentBlocks}
219-
referrerVariant="adaptive_variant"
219+
referrerVariant="adaptive_variation"
220220
referrer="search"
221221
/>,
222222
{

src/app/components/Recommendations/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const Recommendations = ({
3939
}: RecommendationsProps) => {
4040
const { recommendations, script, service, dir, translations } =
4141
use(ServiceContext);
42-
42+
console.log('in recommendations', referrer, referrerVariant);
43+
console.log('in recommendations', topStoriesContent);
4344
const {
4445
palette: { GREY_2 },
4546
} = useTheme();
@@ -58,7 +59,7 @@ const Recommendations = ({
5859
referrerVariant.includes('control')
5960
) {
6061
displayData = data ?? [];
61-
} else if (referrerVariant === 'adaptive_variant') {
62+
} else if (referrerVariant === 'adaptive_variation') {
6263
switch (referrer) {
6364
case 'search':
6465
displayData = getRelatedContentData(blocks ?? []).map(
@@ -83,6 +84,7 @@ const Recommendations = ({
8384
break;
8485
}
8586
}
87+
console.log('in recommendations displayData', displayData);
8688
const componentName = 'midarticle-mostread';
8789
const groupTracker = {
8890
name: title,

src/app/pages/ArticlePage/helpers/index.test.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,29 @@ describe('getUnderArticleComponents', () => {
3030
const keys = getKeys(components);
3131
expect(keys).toEqual(['relatedContent', 'topStories', 'features']);
3232
});
33-
it('returns all components in search order when referrer variant is adaptive_variant and referrer is search', () => {
33+
it('returns all components in search order when referrer variant is adaptive_variation and referrer is search', () => {
3434
const components = getUnderArticleComponents({
3535
...baseProps,
36-
referrerVariant: 'adaptive_variant',
36+
referrerVariant: 'adaptive_variation',
3737
referrer: 'search',
3838
});
3939
const keys = getKeys(components);
4040
expect(keys).toEqual(['relatedContent', 'topStories', 'features']);
4141
});
42-
it('returns all components in social order when referrer variant is adaptive_variant and referrer is social', () => {
42+
it('returns all components in social order when referrer variant is adaptive_variation and referrer is social', () => {
4343
const components = getUnderArticleComponents({
4444
...baseProps,
45-
referrerVariant: 'adaptive_variant',
45+
referrerVariant: 'adaptive_variation',
4646
referrer: 'social',
4747
});
4848
const keys = getKeys(components);
4949
expect(keys).toEqual(['features', 'relatedContent', 'topStories']);
5050
});
5151

52-
it('returns all components in direct order when referrer variant is adaptive_variant and referrer is direct', () => {
52+
it('returns all components in direct order when referrer variant is adaptive_variation and referrer is direct', () => {
5353
const components = getUnderArticleComponents({
5454
...baseProps,
55-
referrerVariant: 'adaptive_variant',
55+
referrerVariant: 'adaptive_variation',
5656
referrer: 'direct',
5757
});
5858
const keys = getKeys(components);
@@ -90,20 +90,20 @@ describe('getUnderArticleComponents', () => {
9090
const keys = getKeys(components);
9191
expect(keys).toEqual(['relatedContent', 'topStories', 'features']);
9292
});
93-
it('returns default order when referrerVariant is adaptive_variant and referrer is null', () => {
93+
it('returns default order when referrerVariant is adaptive_variation and referrer is null', () => {
9494
const components = getUnderArticleComponents({
9595
...baseProps,
96-
referrerVariant: 'adaptive_variant',
96+
referrerVariant: 'adaptive_variation',
9797
referrer: null,
9898
});
9999
const keys = getKeys(components);
100100
expect(keys).toEqual(['relatedContent', 'topStories', 'features']);
101101
});
102102

103-
it('returns default order when referrerVariant is adaptive_variant and referrer is undefined', () => {
103+
it('returns default order when referrerVariant is adaptive_variation and referrer is undefined', () => {
104104
const components = getUnderArticleComponents({
105105
...baseProps,
106-
referrerVariant: 'adaptive_variant',
106+
referrerVariant: 'adaptive_variation',
107107
// referrer is undefined
108108
});
109109
const keys = getKeys(components);

src/app/pages/ArticlePage/helpers/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,17 @@ const getUnderArticleComponents = ({
8585
// leaving the other cases with the original unordered experience. However, this makes it more flexible
8686
// to change the orders for different variants in the future, and is easy to understand.
8787

88-
if (referrerVariant === 'adaptive_variant' && referrer === 'social') {
88+
if (referrerVariant === 'adaptive_variation' && referrer === 'social') {
8989
return [featuresComponent, relatedContent, topStoriesComponent].filter(
9090
Boolean,
9191
);
9292
}
93-
if (referrerVariant === 'adaptive_variant' && referrer === 'direct') {
93+
if (referrerVariant === 'adaptive_variation' && referrer === 'direct') {
9494
return [topStoriesComponent, relatedContent, featuresComponent].filter(
9595
Boolean,
9696
);
9797
}
98-
// Default for when referrerVariant is 'control', 'off', '', or any unknown value and when referrer_variant is 'adaptive_variant' but referrer is 'search''
98+
// Default for when referrerVariant is 'control', 'off', '', or any unknown value and when referrer_variant is 'adaptive_variation' but referrer is 'search''
9999
return [relatedContent, topStoriesComponent, featuresComponent].filter(
100100
Boolean,
101101
);

0 commit comments

Comments
 (0)