import React from 'react' import { render, screen } from '@testing-library/react' import { HeroSection, HeroSectionProps } from './HeroSection' function createHeroSectionProps(props: Partial = {}): HeroSectionProps { return { heroText: 'hero text', heroImageUrlSmall: 'http://heroImageUrlSmall', heroImageUrlLarge: 'http://heroImageUrlLarge', bottomElement: null, ...props, } } describe('HeroSection', () => { describe('illustration', () => { it('should render the title', () => { const props = createHeroSectionProps() render() expect(screen.getByText('hero text')).toBeInTheDocument() }) it('should render a search form', () => { const props = createHeroSectionProps({ bottomElement:
Bottom element
, }) render() expect(screen.getByTestId('bottom-element')).toBeInTheDocument() }) }) })