Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSTEAM1-1408: Populates 'x2' ATI value with 'lite' for .lite pages #12178

Merged
merged 6 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/contexts/RequestContext/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('RequestContext', () => {
isAmp: false,
isApp: false,
isLite: true,
platform: 'canonical',
platform: 'lite',
});
});

Expand Down
2 changes: 2 additions & 0 deletions src/app/contexts/RequestContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export const RequestContextProvider = ({
return 'app';
case isAmp:
return 'amp';
case isLite:
return 'lite';
default:
return 'canonical';
}
Expand Down
2 changes: 2 additions & 0 deletions src/app/lib/analyticsUtils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const getAppType = platform => {
return 'amp';
case 'app':
return 'mobile-app';
case 'lite':
return 'lite';
case 'canonical':
return 'responsive';
default:
Expand Down
5 changes: 5 additions & 0 deletions src/app/lib/analyticsUtils/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ describe('getAppType', () => {
expected: 'mobile-app',
summary: 'should return mobile-app for app',
},
{
platform: 'lite',
expected: 'lite',
summary: 'should return lite for lite',
},
{
platform: 'canonical',
expected: 'responsive',
Expand Down
2 changes: 1 addition & 1 deletion src/app/models/types/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as PAGE_TYPES from '../../routes/utils/pageTypes';

export type Environments = 'local' | 'test' | 'live';

export type Platforms = 'amp' | 'canonical' | 'app';
export type Platforms = 'amp' | 'canonical' | 'app' | 'lite';

export type Direction = 'rtl' | 'ltr';

Expand Down
4 changes: 3 additions & 1 deletion src/integration/integrationTestEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class IntegrationTestEnvironment extends JsdomEnvironment {
} = context.docblockPragmas;
const pageType = getPageTypeFromTestPath(context.testPath);

const platformForPath = platform === 'canonical' ? '' : `.${platform}`;
const platformForPath = ['amp', 'lite'].includes(platform)
? `.${platform}`
: '';

this.pageType = camelCaseToText(pageType);
this.service = service;
Expand Down
Loading