Skip to content

Add cypress for promo link click curations - #14180

Open
HarveyPeachey wants to merge 4 commits into
latestfrom
add-cypress-for-promo-link-click-curations
Open

Add cypress for promo link click curations#14180
HarveyPeachey wants to merge 4 commits into
latestfrom
add-cypress-for-promo-link-click-curations

Conversation

@HarveyPeachey

Copy link
Copy Markdown
Contributor

Resolves JIRA:

Summary

A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.

Code changes

  • List key code changes that have been made.

Testing

  1. List the steps required to test this PR.

Useful Links

Copilot AI review requested due to automatic review settings July 29, 2026 10:57

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.

Pull request overview

This PR adds Cypress end-to-end coverage to verify that clicking a promo “card/container” (not just the inner link) navigates to the expected destination, helping protect the full-card click target behavior on Topic and Home pages.

Changes:

  • Added a Topic Page Cypress test that clicks the first promo container and asserts navigation.
  • Added a Home Page (canonical-only) Cypress test that clicks the first promo container when topic promos exist.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
ws-nextjs-app/cypress/e2e/pageTypes/topicPage/tests.ts Adds a new Topic Page E2E test for promo container click navigation.
ws-nextjs-app/cypress/e2e/pageTypes/homePage/testsForCanonicalOnly.ts Adds a new canonical Home Page E2E test for promo container click navigation (when promos exist).

Comment on lines +46 to +48
describe('Promo click target', () => {
it('should navigate when clicking the first promo container area', () => {
cy.get('body').then($body => {
Comment on lines +120 to +127
cy.get('@firstPromo')
.find('h2 a')
.should('have.attr', 'href')
.then($href => {
// Click container area rather than the anchor itself to verify the full-card click target.
cy.get('@firstPromo').click('topRight');
cy.url().should('eq', $href);
});
Comment on lines +60 to +67
cy.get('@firstPromo')
.find('h2 a')
.should('have.attr', 'href')
.then($href => {
// Click container area rather than the anchor itself to verify the full-card click target.
cy.get('@firstPromo').click('topRight');
cy.url().should('eq', $href);
});
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