import React from 'react' import { render, screen } from '@testing-library/react' import { color } from '../_utils/branding' import { Button } from '../button' import { Text, TextDisplayType } from '../text' import { TotalVoucher } from './TotalVoucher' const renderComponent = (): JSX.Element => ( For your first carpooling, receive{' '} €25 {' '} gas or a{' '} €40 {' '} wash voucher } terms={{ href: 'https://www.blablacar.fr', label: 'More informations', }} stepsTitle={ How to get your voucher{' '} Total logo } steps={[ { label: 'Step 1', description: 'Publish your first trip', }, { label: 'Step 2', description: 'Share your trip with at least one passenger', }, { label: 'Step 3', description: 'Register your IBAN and your postal address', }, { label: 'Step 4', description: 'Receive your Total voucher in your mailbox', }, ]} button={} /> ) describe('TotalVoucher', () => { it('should render the component', () => { render(renderComponent()) expect(screen.getByRole('heading', { level: 2 })).toHaveTextContent( 'Discover your welcome gift on BlaBlaCar', ) expect(screen.getByRole('img', { name: 'Total logo' })).toBeInTheDocument() expect(screen.getByRole('link', { name: 'Publish a ride' })).toHaveAttribute( 'href', 'https://www.blablacar.fr/offer-seats', ) }) })