Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Comment on lines +46 to +48
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);
});
Comment on lines +60 to +67

cy.go('back');
});
});
});

// Skipping this one due to a bug caused by repeatedly opening and closing the modal
describe.skip('Portrait Video Curations', () => {
beforeEach(() => {
Expand Down
19 changes: 19 additions & 0 deletions ws-nextjs-app/cypress/e2e/pageTypes/topicPage/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Comment on lines +120 to +127

cy.go('back');
});

it('clicking the message banner should navigate to the correct page', () => {
if (messageBanner) {
cy.get(
Expand Down
Loading