From eda161a9861c0661a0b67defdebb2dadb876d92c Mon Sep 17 00:00:00 2001 From: HarveyPeachey Date: Fri, 3 Jul 2026 12:24:15 +0100 Subject: [PATCH 1/2] adds test for clicking promo --- .../cypress/e2e/pageTypes/topicPage/tests.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ws-nextjs-app/cypress/e2e/pageTypes/topicPage/tests.ts b/ws-nextjs-app/cypress/e2e/pageTypes/topicPage/tests.ts index 5d4b7322d25..16ce902411d 100644 --- a/ws-nextjs-app/cypress/e2e/pageTypes/topicPage/tests.ts +++ b/ws-nextjs-app/cypress/e2e/pageTypes/topicPage/tests.ts @@ -110,6 +110,25 @@ export default ({ service, pageType, variant = 'default', path }) => { cy.go('back'); }); + it('Clicking the first promo container should navigate to the correct page', () => { + cy.get('[data-testid="topic-promos"]') + .first() + .children() + .first() + .as('firstPromo'); + + 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); + }); + + cy.go('back'); + }); + it('clicking the message banner should navigate to the correct page', () => { if (messageBanner) { cy.get( From a9f738812c399f4886acfe4b59da23a56fbee6c8 Mon Sep 17 00:00:00 2001 From: HarveyPeachey Date: Fri, 3 Jul 2026 12:24:21 +0100 Subject: [PATCH 2/2] adds test for clicking promo --- .../homePage/testsForCanonicalOnly.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ws-nextjs-app/cypress/e2e/pageTypes/homePage/testsForCanonicalOnly.ts b/ws-nextjs-app/cypress/e2e/pageTypes/homePage/testsForCanonicalOnly.ts index 7d1ab970cb1..20a49043277 100644 --- a/ws-nextjs-app/cypress/e2e/pageTypes/homePage/testsForCanonicalOnly.ts +++ b/ws-nextjs-app/cypress/e2e/pageTypes/homePage/testsForCanonicalOnly.ts @@ -43,6 +43,34 @@ export default ({ service }) => { }); }); + describe('Promo click target', () => { + it('should navigate when clicking the first promo container area', () => { + cy.get('body').then($body => { + if ($body.find('[data-testid="topic-promos"] li').length === 0) { + cy.log('No topic promos found on the page'); + return; + } + + cy.get('[data-testid="topic-promos"]') + .first() + .find('li') + .first() + .as('firstPromo'); + + 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); + }); + + cy.go('back'); + }); + }); + }); + // Skipping this one due to a bug caused by repeatedly opening and closing the modal describe.skip('Portrait Video Curations', () => { beforeEach(() => {