Skip to content

Corrresponding resonance values added - #14385

Draft
victranfield wants to merge 2 commits into
latestfrom
WS-2949-parity-resonance-reverb
Draft

Corrresponding resonance values added#14385
victranfield wants to merge 2 commits into
latestfrom
WS-2949-parity-resonance-reverb

Conversation

@victranfield

@victranfield victranfield commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Resolves JIRA: https://bbc.atlassian.net/browse/WS-2949

Summary

Unit tests fixed, Resonance values added to ATIAnalytics/atiUrl/index

Code changes

  • List key code changes that have been made.

Testing

  1. List the steps required to test this PR.

Useful Links

Copilot AI lite review requested due to automatic review settings September 10, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are maintainability/documentation issues in the changed code (commented-out production/test code and removed activation-beacon JSDoc) that should be resolved before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates ATI Analytics’ Resonance beacon model to include additional parity fields (e.g., page title, published/updated timestamps, LDP tags/IDs, section) and aligns existing unit tests with the expanded model so the suite passes.

Changes:

  • Extend buildResonanceAnalyticsModel to optionally include pageTitle, publicationDate, pubUpdateDate, ldpTags, ldpIds, and section.
  • Update ATIAnalytics container/unit tests to expect the additional Resonance properties.
  • Update atiUrl unit tests for the Resonance model to include assertions for the new optional fields.
File summaries
File Description
src/app/components/ATIAnalytics/index.client.test.tsx Updates the container test expectations to include the newly-added Resonance pageview properties.
src/app/components/ATIAnalytics/atiUrl/index.ts Adds optional parity fields into the Resonance beacon payload (and removes some inline documentation in the activation model).
src/app/components/ATIAnalytics/atiUrl/index.client.test.ts Updates Resonance model unit tests to validate the new optional fields.
Review details

Suppressed comments (1)

src/app/components/ATIAnalytics/atiUrl/index.client.test.ts:105

  • Avoid committing commented-out tests; this block reads like a pending coverage check for optional fields, but as comments it won’t protect behaviour. Either re-enable it (and ensure the assertions pass) or remove it entirely.
      // it('should omit optional parity fields when provided as empty strings', () => {
      //   const result = buildResonanceAnalyticsModel({
      //     ...input,
      //     pageTitle: '',
      //     timePublished: '',
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +88 to +100
// it('should return url and referrerUrl using getHref and getReferrer', () => {
// const result = buildResonanceAnalyticsModel(input);

// expect(result.pageviewProperties.url).toBe('getHref');
// expect(result.pageviewProperties.referrerUrl).toBe('getReferrer');
// });

// it('should populate app.type using getAppType', () => {
// const result = buildResonanceAnalyticsModel(input);

// expect(result.baseProperties.app.type).toBe('getAppType');
// });

Comment on lines 53 to 60
const env = getEnvConfig().SIMORGH_APP_ENV;
// const href = getHref(platform);
// const referrer = getReferrer(platform);

// const aggregatedCampaigns = (Array.isArray(campaigns) ? campaigns : [])
// .map(({ campaignName }) => campaignName)
// .join('~');

* Follows the "Activation (v1.0.1) on Web" event-catalogue spec (viewability model),
* spec ID ACTIVATION_EVENT_SPEC_ID - see https://broxy.tools.bbc.co.uk/bbc-event-catalogue/xbbc/viewability-events/specs/experiment/activation-web/1.0.1/
*/
export const buildActivationEventModel = ({
@victranfield victranfield changed the title unit tests now passing, values added to ATIAnalytics index/atiUrl Corrresponding resonance values added Sep 10, 2026
@victranfield
victranfield marked this pull request as draft September 10, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants