Skip to content

Commit

Permalink
fix: badoo content tests (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
annarhughes committed Sep 16, 2024
1 parent 2f53837 commit 6df6559
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
7 changes: 5 additions & 2 deletions components/cards/SessionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useTranslations } from 'next-intl';
import { useRouter } from 'next/router';
import { useState } from 'react';
import { rowStyle } from '../../styles/common';
import Link from '../common/Link';
import { SessionProgressDisplay } from '../session/SessionProgressDisplay';

const cardStyle = {
Expand Down Expand Up @@ -65,7 +66,7 @@ const SessionCard = (props: SessionCardProps) => {
const t = useTranslations('Courses');
const router = useRouter();

const handleCardClick = () => {
const scrollToSignupBanner = () => {
if (isLoggedIn) {
router.push(`/${session.full_slug}`);
} else {
Expand All @@ -91,7 +92,9 @@ const SessionCard = (props: SessionCardProps) => {
<Card sx={cardStyle}>
<CardActionArea
sx={cardActionStyle}
onClick={handleCardClick}
{...(isLoggedIn
? { onClick: scrollToSignupBanner }
: { href: `/${session.full_slug}`, component: Link })}
aria-label={`${t('navigateToSession')} ${session.name}`}
>
<CardContent sx={cardContentStyle}>
Expand Down
25 changes: 5 additions & 20 deletions cypress/integration/tests/welcome.badoo.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ describe('Welcome badoo page should display', () => {
);
});
it('about the program content', () => {
cy.checkImage('person with legs crossed holding heart', 'badoo_welcome_1');
cy.get('h2').should('contain', 'About the program');
cy.get('p').should(
'contain',
'Everyone’s healing journey is different. When we experience trauma due to sexual assault and relationship abuse, we may need support. Badoo partnered with Bloom to create a free, curated, online trauma support program for survivors. This program has been developed based on feedback from the global Badoo and Bloom communities.',
cy.checkImage(
'Illustration of a person sitting down with a laptop. Illustrations of video, messaging and flowers are included.',
'landing_page_illo',
);
});

it('about Bloom content', () => {
cy.checkImage('leaves with a rose bloom', 'leaf_mix_bloom');
cy.get('h2').should('contain', 'About Bloom');
cy.get('h2').should('contain', 'About the program');
cy.get('p').should(
'contain',
'Bloom informs and empowers survivors by offering remote courses that combine the insights of survivors globally on trauma and gender-based violence with therapeutic practices to heal from trauma. Bloom is a programme by Chayn.',
'Everyone’s healing journey is different. When we experience trauma such as sexual assault and relationship abuse, we may need support to manage the aftermath effects. Badoo has partnered with Bloom to create a free, custom curated online trauma support program for survivors of sexual assault and relationship abuse. This program has been developed based on feedback from the global Badoo and Bloom communities.',
);
});

Expand All @@ -49,15 +43,6 @@ describe('Welcome badoo page should display', () => {
);
});

it('about you content', () => {
cy.checkImage('leaves with fire', 'leaf_mix_fire');
cy.get('h2').should('contain', 'About you');
cy.get('p').should(
'contain',
'The programme is available to any Badoo user who reports sexual abuse or assault to Badoo, regardless of your background, race, age, disability, religion or belief, sexuality, gender identity or expression, or life circumstances – we are here for you.',
);
});

describe('for a non-logged in user', () => {
it('get started button', () => {
cy.get('a[href="/auth/register?partner=badoo"]').should('contain', 'Get started');
Expand Down

0 comments on commit 6df6559

Please sign in to comment.