Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix badoo tests #1139

Merged
merged 2 commits into from
Sep 16, 2024
Merged
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
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
Loading