Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
0611cfa
Delete buildATIPageTrackPath function
alex-magana Dec 8, 2025
f896161
Remove buildATIPageTrackPath page view tracking unit tests
alex-magana Dec 8, 2025
1e5c7ab
Delete buildATIPageTrackPath and buildPageATIUrl
alex-magana Dec 8, 2025
509ac33
Delete buildPageATIUrl unit tests
alex-magana Dec 8, 2025
43b5533
Remove buildATIUrl and buildPageATIUrl functions
alex-magana Dec 8, 2025
e7ff184
Delete buildPageATIUrl integration test
alex-magana Dec 8, 2025
e5c089c
Delete buildATIUrl unit tests
alex-magana Dec 8, 2025
26e4b8f
Delete buildATIUrl from the ATIAnalytics component
alex-magana Dec 8, 2025
5924a1d
Merge branch 'WS-222-clean-up-AmpATIAnalytics' into WS-222-clean-up-C…
alex-magana Dec 9, 2025
0f3c929
Remove useReverb flag from ATIAnalytics component
alex-magana Dec 9, 2025
d3cd486
Remove url argument and 'fetch' invocation
alex-magana Dec 9, 2025
af3dbd7
Remove atiPageViewUrlString and atiPageViewUrl variables from Canonic…
alex-magana Dec 9, 2025
4c7abb9
Remove baseUrl and pageviewParams from ATIAnalyticsProps
alex-magana Dec 9, 2025
2c682d6
Remove unused getEnvConfig
alex-magana Dec 9, 2025
732b2b2
Remove redundant ATIAnalyticsPropsExport type
alex-magana Dec 9, 2025
7022927
Change how reverbParams is passed to getNoScriptTrackingPixelUrl
alex-magana Dec 9, 2025
2592b4c
Delete buildATIEventTrackUrl function
alex-magana Dec 10, 2025
bec83cd
Remove atiClickTrackingUrl
alex-magana Dec 10, 2025
d3d0532
Exclusively use Reverb in sendEventBeacon
alex-magana Dec 10, 2025
063faea
Remove unused utilities imports
alex-magana Dec 10, 2025
0534d0b
Delete buildATIEventTrackUrl unit tests
alex-magana Dec 10, 2025
7698846
Remove unused mocks
alex-magana Dec 10, 2025
377c9fc
Remove unused arguments
alex-magana Dec 10, 2025
b519c0f
Delete splitUrl utility
alex-magana Dec 11, 2025
9842ea2
Remove CPV tests
alex-magana Dec 11, 2025
a5a9af7
Update no-js tests
alex-magana Dec 11, 2025
c4c13ed
Update CanonicalATIAnalytics unit tests
alex-magana Dec 11, 2025
fb410bf
Add xtor support for the Lite site to align with Canonical
alex-magana Dec 15, 2025
00facac
Remove xtor tests handled by smart-tag
alex-magana Dec 15, 2025
14f0dd8
Remove useReverb false test - Reverb is enabled for all services
alex-magana Dec 15, 2025
0b46169
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Dec 15, 2025
1f40a8e
Refactor EventTrackingContext to remove dependence on buildATIEventTr…
alex-magana Dec 15, 2025
874764c
Add page view tracking params tests for other page types
alex-magana Dec 15, 2025
fc1b846
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Dec 15, 2025
0ee9160
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Dec 16, 2025
8845d21
Remove baseUrl and pageviewParams from AMP tests
alex-magana Dec 16, 2025
e864e4b
Co-locate splitUrl utility in AmpATIAnalytics tests
alex-magana Dec 16, 2025
056d996
Catch test triage
alex-magana Dec 17, 2025
54fe26a
Merge branch 'WS-222-clean-up-CanonicalATIAnalytics' of github.com:bb…
alex-magana Dec 17, 2025
3e87182
Test Reverb module error handling
alex-magana Dec 18, 2025
a1aee12
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Dec 18, 2025
8f35d08
Delete constructATIUrl module
alex-magana Dec 18, 2025
1146fe6
Delete constructATIUrl from the click tracking hook
alex-magana Dec 18, 2025
365e6d1
Convert useClickTrackerHandler CPV tests to viewability
alex-magana Dec 19, 2025
dda8ffb
Update click tracking and error handling specs
alex-magana Dec 19, 2025
a824b8d
Fix lite site click tracking tests
alex-magana Dec 19, 2025
84849a7
Merge branch 'WS-222-clean-up-CanonicalATIAnalytics' of github.com:bb…
alex-magana Dec 19, 2025
bf65805
Update bundle minimum and maximum thresholds
alex-magana Dec 22, 2025
47c9421
Use device timezone for static tracking
alex-magana Dec 22, 2025
591af80
Refactor useViewTracker tests
alex-magana Dec 23, 2025
99c2dd6
Resolve and refactor remainder of useViewTracker failing tests
alex-magana Dec 24, 2025
767a158
Remove unused urlToObject function
alex-magana Dec 24, 2025
350d4b3
Remove useReverb from the service config
alex-magana Dec 30, 2025
d6d65ce
Remove useReverb from Home Page e2es
alex-magana Dec 30, 2025
5af2307
Remove useReverb from Live Radio Page e2es
alex-magana Dec 30, 2025
86e6a6f
Remove useReverb from Most Read Page e2es
alex-magana Dec 30, 2025
f068498
Remove useReverb from OnDemand Audio Page e2es
alex-magana Dec 30, 2025
042feb8
Remove useReverb from onDemand TV Page e2es
alex-magana Dec 30, 2025
32338b2
Remove useReverb from Topic Page e2es
alex-magana Dec 30, 2025
62b32a5
Remove useReverb from atiAnalytics e2es
alex-magana Dec 30, 2025
aef9821
Remove useReverb from the ATIAnalytics tests
alex-magana Dec 30, 2025
b25b4e9
Remove useReverb from sendEventBeacon tests
alex-magana Dec 30, 2025
0466f2f
Remove useReverb from useClickTrackerHandler tests
alex-magana Dec 30, 2025
0b8ec61
Remove useReverb from useCustomEventTracker tests
alex-magana Dec 30, 2025
cd51c9b
Remove useReverb from useViewTracker tests
alex-magana Dec 30, 2025
28084f5
Remove useReverb from dispatchTrackingRequests tests
alex-magana Dec 30, 2025
6df3186
Remove useReverb from Next.js Article Page tests
alex-magana Dec 30, 2025
256331a
Remove useReverb from Next.js Languages Page tests
alex-magana Dec 30, 2025
e42c131
Remove useReverb from Next.js Live Page tests
alex-magana Dec 30, 2025
509d131
Remove useReverb from Next.js Media Asset Page tests
alex-magana Dec 30, 2025
b1ae953
Remove useReverb from Next.js Photo Gallery Page tests
alex-magana Dec 30, 2025
06a090e
Remove useReverb from Next.js ATI Analytics tests
alex-magana Dec 30, 2025
7595572
Remove useReverb from Next.js Story Page tests
alex-magana Dec 30, 2025
50baec7
Remove useReverb from event tracking hooks
alex-magana Dec 30, 2025
f221417
Remove useReverb from articleLiteSiteLink tests
alex-magana Dec 30, 2025
da01514
Remove useReverb from billboard tests
alex-magana Dec 30, 2025
8d0bb1c
Remove useReverb from the featuresAnalysis tests
alex-magana Dec 30, 2025
46cd19f
Remove useReverb from latestMedia tests
alex-magana Dec 30, 2025
8043997
Remove useReverb from liveMedia tests
alex-magana Dec 30, 2025
0f4a5bf
Remove useReverb from messageBanner tests
alex-magana Dec 30, 2025
19b9f4b
Remove useReverb from mostRead tests
alex-magana Dec 30, 2025
b9b33a2
Remove useReverb from navigation tests
alex-magana Dec 30, 2025
98718c7
Remove useReverb from podcastLinks tests
alex-magana Dec 30, 2025
2aca299
Remove useReverb from podcastPromo tests
alex-magana Dec 30, 2025
71529db
Remove useReverb from portraitVideoCarousel tests
alex-magana Dec 30, 2025
308f4e2
Remove useReverb from portraitVideoModal tests
alex-magana Dec 30, 2025
6480337
Remove useReverb from radioSchedule tests
alex-magana Dec 30, 2025
e665f0b
Remove useReverb from recentAudioEpisodes tests
alex-magana Dec 30, 2025
1ba5189
Remove useReverb from recommendations tests
alex-magana Dec 30, 2025
d11ac47
Remove useReverb from relatedContent tests
alex-magana Dec 30, 2025
ba5f3c9
Remove useReverb from relatedTopics tests
alex-magana Dec 30, 2025
0bb7380
Remove useReverb from scrollablePromo tests
alex-magana Dec 30, 2025
030c59f
Remove useReverb from share tests
alex-magana Dec 30, 2025
efa8b5d
Remove useReverb from socialEmbed tests
alex-magana Dec 30, 2025
71e3bea
Remove useReverb from topStories tests
alex-magana Dec 30, 2025
a17e981
Remove useReverb from Next.js articleLiteSiteLink tests
alex-magana Dec 31, 2025
6c9890a
Remove useReverb from Next.js featuresAnalysis tests
alex-magana Dec 31, 2025
d77ccd5
Remove useReverb from Next.js latestMedia tests
alex-magana Dec 31, 2025
66c6f83
Remove useReverb from Next.js mostRead tests
alex-magana Dec 31, 2025
c1de891
Remove useReverb from Next.js navigation tests
alex-magana Dec 31, 2025
6948598
Remove useReverb from Next.js podcastPromo tests
alex-magana Dec 31, 2025
742e3ef
Remove useReverb from Next.js recommendations tests
alex-magana Dec 31, 2025
277d3d7
Remove useReverb from Next.js relatedContent tests
alex-magana Dec 31, 2025
05ec64d
Remove useReverb from Next.js relatedTopics tests
alex-magana Dec 31, 2025
38bb10e
Remove useReverb from Next.js scrollablePromo test
alex-magana Dec 31, 2025
53b23cc
Remove useReverb from Next.js socialEmbed test
alex-magana Dec 31, 2025
99b4cf4
Remove useReverb from Next.js topStories test
alex-magana Dec 31, 2025
a80cba0
Remove useReverb from type definitions
alex-magana Dec 31, 2025
180ebfb
Remove useReverb from withContexts snapshot
alex-magana Dec 31, 2025
e4ceee6
Update error exclusion description
alex-magana Dec 31, 2025
ed3c17b
Remove useReverb from page view and component tracking assertions
alex-magana Dec 31, 2025
9382db0
Remove atiUrl argument from processClientDeviceAndSendStaticBeacon
alex-magana Jan 1, 2026
95a738f
Update integration test snapshots to reflect 2026 in the copyright
alex-magana Jan 1, 2026
7f9eb09
Update Next.js integration test snapshots to reflect 2026 in the copy…
alex-magana Jan 1, 2026
e0fe928
Fix linting error
alex-magana Jan 1, 2026
0b44915
Update snapshot to reflect 2026 in the page copyright
alex-magana Jan 1, 2026
9049727
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 2, 2026
fc9fdfe
Delete unused getScreenInfo function
alex-magana Jan 2, 2026
8dc0670
Delete unused getBrowserViewPort function
alex-magana Jan 2, 2026
e95249a
Delete unused getDeviceLanguage function
alex-magana Jan 2, 2026
472c1c1
Delete unused getAtiUrl function
alex-magana Jan 2, 2026
b4e218f
Delete unused getEventInfo function
alex-magana Jan 2, 2026
7944008
Delete unused getCampaignType function
alex-magana Jan 2, 2026
0df0a67
Delete unused getATIMarketingString function
alex-magana Jan 2, 2026
fb8f419
Delete unused getRSSMarketingString function
alex-magana Jan 2, 2026
946674f
Remove unused variable
alex-magana Jan 2, 2026
330e6c3
Delete unused getXtorMarketingString function
alex-magana Jan 2, 2026
b9ef2ad
Delete unused getContentId function
alex-magana Jan 2, 2026
bf67df8
Remove unused FIXTURE_PAGEDATA variable
alex-magana Jan 2, 2026
b041386
Delete unused getDisplayMarketingString function
alex-magana Jan 2, 2026
1fd47a7
Delete unused getCustomMarketingString function
alex-magana Jan 2, 2026
1082453
Delete unused getEmailMarketingString function
alex-magana Jan 2, 2026
f4d675c
Delete unused getSLMarketingString function
alex-magana Jan 2, 2026
88b6d0e
Delete unused getAffiliateMarketingString function
alex-magana Jan 2, 2026
48eeba5
Delete unused getThingAttributes function
alex-magana Jan 2, 2026
b3aef2c
Delete unused getAtUserId function
alex-magana Jan 2, 2026
6ab22dd
Delete unused getCurrentTime function
alex-magana Jan 2, 2026
de6f1f8
Delete unused getPublishedDatetime function
alex-magana Jan 2, 2026
7b1384e
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 5, 2026
d24a3da
Remove analyticsUtils import
alex-magana Jan 5, 2026
d4cf896
Remove redundant imports
alex-magana Jan 5, 2026
cd1191e
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 5, 2026
d8d83b7
Reinstate idclient assertion for the Next.js page view e2es
alex-magana Jan 5, 2026
03b8ca0
Remove idclient value assertion
alex-magana Jan 5, 2026
d72d1d9
Ensure idclient exists in viewability events request
alex-magana Jan 5, 2026
90f78f8
Pass applicationType in assertATIComponentClickEvent and assertATICom…
alex-magana Jan 5, 2026
91b918c
Include applicationType in view and click tests where absent
alex-magana Jan 5, 2026
e713831
Merge pull request #13582 from bbc/WS-222-clean-up-atuserid-assertions
alex-magana Jan 6, 2026
de1d360
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 6, 2026
b55b8c2
Remove redundant useReverb flag
alex-magana Jan 6, 2026
ac30ec6
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 7, 2026
ca884d5
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 7, 2026
2de829f
Update bundle upper threshold
alex-magana Jan 7, 2026
97a51da
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 7, 2026
ca3312c
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 8, 2026
3fe601e
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 8, 2026
d8718a3
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 8, 2026
1cf5e5d
Update bundle thresholds
alex-magana Jan 8, 2026
624f14f
Merge branch 'WS-222-clean-up-CanonicalATIAnalytics' of github.com:bb…
alex-magana Jan 8, 2026
516d66d
Merge branch 'latest' into WS-222-clean-up-CanonicalATIAnalytics
alex-magana Jan 8, 2026
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
1 change: 0 additions & 1 deletion cypress/e2e/pages/liveRadio/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ const atiAnalyticsTestSuites = [
siteId: 51,
applicationType: 'responsive',
contentType: 'player-live',
useReverb: true,
tests: [
assertPageView,
assertRadioScheduleComponentView,
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/pages/mostReadPage/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const atiAnalyticsTestSuites = [
siteId: 40,
applicationType: 'responsive',
contentType: 'list-datadriven',
useReverb: true,
tests: [
assertPageView,
assertDropdownNavigationComponentClick,
Expand All @@ -103,7 +102,6 @@ const atiAnalyticsAmpTestSuites = atiAnalyticsTestSuites.map(testSuite => {
return {
...testSuite,
path: getPathWithSuffix({ path: testSuite.path, suffix: '.amp' }),
useReverb: true,
applicationType: 'amp',
tests: [assertPageView],
};
Expand All @@ -126,7 +124,6 @@ const atiAnalyticsLiteTestSuites = atiAnalyticsTestSuites.map(testSuite => {
...testSuite,
path: getPathWithSuffix({ path: testSuite.path, suffix: '.lite' }),
applicationType: 'lite',
useReverb: true,
tests: [...liteSiteTests],
};
});
Expand Down
8 changes: 0 additions & 8 deletions cypress/e2e/pages/onDemandAudio/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ const atiAnalyticsTestSuites = [
siteId: 3,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [
assertPageView,
assertRecentAudioEpisodesComponentView,
Expand All @@ -483,7 +482,6 @@ const atiAnalyticsTestSuites = [
siteId: 5,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [assertPageView],
},
{
Expand All @@ -494,7 +492,6 @@ const atiAnalyticsTestSuites = [
siteId: 40,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [...atiAnalyticsPodcastComponentTests],
},
{
Expand All @@ -505,7 +502,6 @@ const atiAnalyticsTestSuites = [
siteId: 40,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [...atiAnalyticsPodcastComponentTests],
},
{
Expand All @@ -516,7 +512,6 @@ const atiAnalyticsTestSuites = [
siteId: 33,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [...atiAnalyticsPodcastComponentTests],
},
{
Expand All @@ -527,7 +522,6 @@ const atiAnalyticsTestSuites = [
siteId: 33,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [...atiAnalyticsPodcastComponentTests],
},
{
Expand All @@ -539,7 +533,6 @@ const atiAnalyticsTestSuites = [
siteId: 94,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [...atiAnalyticsPodcastComponentTests],
},
];
Expand All @@ -561,7 +554,6 @@ const atiAnalyticsLiteTestSuites = atiAnalyticsTestSuites.map(testSuite => {
...testSuite,
path: getPathWithSuffix({ path: testSuite.path, suffix: '.lite' }),
applicationType: 'lite',
useReverb: false,
siteId: testSuite.siteId,
tests: [...liteSiteTests],
};
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/pages/onDemandTV/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ const atiAnalyticsTestSuites = [
siteId: 3,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [assertPageView],
},
{
Expand All @@ -222,7 +221,6 @@ const atiAnalyticsTestSuites = [
siteId: 3,
applicationType: 'responsive',
contentType: 'player-episode',
useReverb: true,
tests: [assertPageView],
},
];
Expand Down Expand Up @@ -252,7 +250,6 @@ const atiAnalyticsLiteTestSuites = atiAnalyticsTestSuites.map(testSuite => {
...testSuite,
path: getPathWithSuffix({ path: testSuite.path, suffix: '.lite' }),
applicationType: 'lite',
useReverb: false,
siteId: testSuite.siteId,
tests: [...liteSiteTests],
};
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/pages/topicPage/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ const atiAnalyticsTestSuites = [
siteId: 59,
applicationType: 'responsive',
contentType: 'index-category',
useReverb: true,
componentTrackingContentType: 'topic-page',
tests: [assertPageView],
},
Expand All @@ -100,7 +99,6 @@ const atiAnalyticsTestSuites = [
applicationType: 'responsive',
contentType: 'index-category',
componentTrackingContentType: 'topic-page',
useReverb: true,
tests: [
assertPageView,
assertScrollableNavigationComponentView,
Expand Down Expand Up @@ -130,7 +128,6 @@ const atiAnalyticsLiteTestSuites = atiAnalyticsTestSuites.map(testSuite => {
...testSuite,
path: getPathWithSuffix({ path: testSuite.path, suffix: '.lite' }),
applicationType: 'lite',
useReverb: false,
siteId: testSuite.siteId,
tests: [...liteSiteTests],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const { ARTICLE_LITE_SITE_LINK } = COMPONENTS;
export const assertArticleLiteSiteLinkComponentView = ({
pageIdentifier,
contentType,
useReverb,
path,
applicationType,
siteId,
Expand All @@ -23,7 +22,6 @@ export const assertArticleLiteSiteLinkComponentView = ({
component: ARTICLE_LITE_SITE_LINK,
pageIdentifier,
contentType,
useReverb,
applicationType,
siteId,
});
Expand All @@ -33,7 +31,6 @@ export const assertArticleLiteSiteLinkComponentView = ({
export const assertArticleLiteSiteLinkComponentClick = ({
pageIdentifier,
contentType,
useReverb,
path,
applicationType,
siteId,
Expand All @@ -53,7 +50,6 @@ export const assertArticleLiteSiteLinkComponentClick = ({
component: ARTICLE_LITE_SITE_LINK,
pageIdentifier,
contentType,
useReverb,
applicationType,
siteId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const { FEATURES } = COMPONENTS;
export const assertFeaturesAnalysisComponentView = ({
pageIdentifier,
contentType,
useReverb,
path,
applicationType,
siteId,
Expand All @@ -21,7 +20,6 @@ export const assertFeaturesAnalysisComponentView = ({
component: FEATURES,
pageIdentifier,
contentType,
useReverb,
applicationType,
siteId,
});
Expand All @@ -31,7 +29,6 @@ export const assertFeaturesAnalysisComponentView = ({
export const assertFeaturesAnalysisComponentClick = ({
pageIdentifier,
contentType,
useReverb,
path,
applicationType,
siteId,
Expand All @@ -49,7 +46,6 @@ export const assertFeaturesAnalysisComponentClick = ({
component: FEATURES,
pageIdentifier,
contentType,
useReverb,
applicationType,
siteId,
});
Expand Down
61 changes: 27 additions & 34 deletions cypress/e2e/specialFeatures/atiAnalytics/assertions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {
import {
ATI_PAGE_VIEW,
ATI_PAGE_VIEW_REVERB,
// ATI_USER_ID_COOKIE,
ATI_USER_ID_COOKIE,
getATIParamsFromURL,
interceptATIAnalyticsBeacons,
getExpectedAtiDestination,
} from '../helpers';
import environment from '../../../../support/helpers/getAppEnv';

const usesReverbViewabilityModel = applicationType =>
applicationType !== 'lite';
!['lite', 'amp'].includes(applicationType);

const getAppName = service => {
if (service === 'ws') {
Expand Down Expand Up @@ -93,7 +93,14 @@ const assertLocationSpecificPianoDestinationExists = ({ service }) => {
});
};

const assertReverbViewabilityComponentEventParamsExist = ({ params }) => {
const assertReverbViewabilityComponentEventParamsExist = ({
params,
applicationType,
}) => {
if (['responsive', 'lite'].includes(applicationType)) {
expect(params).to.have.property('idclient');
}

expect(params).to.have.property('s'); // destination
expect(params).to.have.property('events'); // event details
expect(params).to.have.property('context');
Expand Down Expand Up @@ -183,7 +190,6 @@ const validateViewabilityEventDetails = ({ payload, actionType }) => {
};

export const assertPageView = ({
useReverb,
pageIdentifier,
applicationType,
contentType,
Expand All @@ -196,10 +202,9 @@ export const assertPageView = ({
cy.visit(path, { retryOnStatusCodeFailure: true });

const useViewabilty = usesReverbViewabilityModel(applicationType);
const atiPageViewAlias =
useReverb && useViewabilty && applicationType !== 'amp'
? ATI_PAGE_VIEW_REVERB
: ATI_PAGE_VIEW;
const atiPageViewAlias = useViewabilty
? ATI_PAGE_VIEW_REVERB
: ATI_PAGE_VIEW;

cy.wait(`@${atiPageViewAlias}`).then(({ request }) => {
const params = getATIParamsFromURL(request.url);
Expand All @@ -210,13 +215,12 @@ export const assertPageView = ({
applicationType,
});

// TODO: Commenting out temporarily until old ATI code is removed - https://bbc.atlassian.net/browse/WS-222
// if (['responsive', 'lite'].includes(applicationType)) {
// expect(params.idclient).to.equal(
// ATI_USER_ID_COOKIE,
// 'params.idclient (atuserid cookie value)',
// );
// }
if (['responsive', 'lite'].includes(applicationType)) {
expect(params.idclient).to.equal(
ATI_USER_ID_COOKIE,
'params.idclient (atuserid cookie value)',
);
}

expect(params.p).to.equal(pageIdentifier, 'params.p (page identifier)');
expect(parseInt(params.s2, 10)).to.equal(
Expand Down Expand Up @@ -246,20 +250,12 @@ export const assertPageView = ({
const assertViewabilityModelViewEvent = ({
pageIdentifier,
params,
// applicationType,
applicationType,
siteId,
}) => {
const eventContext = JSON.parse(params.context);

assertReverbViewabilityComponentEventParamsExist({ params });

// TODO: Commenting out temporarily until old ATI code is removed - https://bbc.atlassian.net/browse/WS-222
// if (['responsive', 'lite'].includes(applicationType)) {
// expect(params.idclient).to.equal(
// ATI_USER_ID_COOKIE,
// 'params.idclient (atuserid cookie value)',
// );
// }
assertReverbViewabilityComponentEventParamsExist({ params, applicationType });

expect(params.events).to.satisfy(
payload =>
Expand All @@ -275,6 +271,7 @@ export const assertATIComponentViewEvent = ({
component,
pageIdentifier,
contentType,
applicationType,
siteId,
}) => {
const requestAlias = `@${component}-viewability-view`;
Expand All @@ -289,6 +286,7 @@ export const assertATIComponentViewEvent = ({
pageIdentifier,
contentType,
params,
applicationType,
siteId,
});
});
Expand All @@ -297,23 +295,16 @@ export const assertATIComponentViewEvent = ({
const assertViewabilityModelClickEvent = ({
pageIdentifier,
params,
// applicationType,
applicationType,
siteId,
}) => {
const eventContext = JSON.parse(params.context);

assertReverbViewabilityComponentEventParamsExist({
params,
applicationType,
});

// TODO: Commenting out temporarily until old ATI code is removed - https://bbc.atlassian.net/browse/WS-222
// if (['responsive', 'lite'].includes(applicationType)) {
// expect(params.idclient).to.equal(
// ATI_USER_ID_COOKIE,
// 'params.idclient (atuserid cookie value)',
// );
// }

expect(params.events).to.satisfy(
payload =>
validateViewabilityEventDetails({
Expand All @@ -331,6 +322,7 @@ export const assertATIComponentClickEvent = ({
component,
contentType,
pageIdentifier,
applicationType,
siteId,
}) => {
const requestAlias = `@${component}-viewability-click`;
Expand All @@ -344,6 +336,7 @@ export const assertATIComponentClickEvent = ({
contentType,
pageIdentifier,
params,
applicationType,
siteId,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const { LATEST_MEDIA } = COMPONENTS;
export const assertLatestMediaComponentView = ({
pageIdentifier,
contentType,
useReverb,
path,
applicationType,
siteId,
Expand All @@ -21,7 +20,6 @@ export const assertLatestMediaComponentView = ({
component: LATEST_MEDIA,
pageIdentifier,
contentType,
useReverb,
applicationType,
siteId,
});
Expand All @@ -31,7 +29,6 @@ export const assertLatestMediaComponentView = ({
export const assertLatestMediaComponentClick = ({
pageIdentifier,
contentType,
useReverb,
path,
applicationType,
siteId,
Expand All @@ -51,7 +48,6 @@ export const assertLatestMediaComponentClick = ({
component: LATEST_MEDIA,
pageIdentifier,
contentType,
useReverb,
applicationType,
siteId,
});
Expand Down
Loading
Loading