import React from 'react'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import dialogIllustration from 'assets/dialogIllustration.svg'; import Dialog, { Props } from '../index'; describe('Dialog', () => { const baseProps = (): Props => ({ message: 'Thank you for reading this meaninglessly long message', actionLabel: 'Got it', }); it('should render', () => { const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); }); it('should render with title', () => { const props = baseProps(); props.title = 'Hi there'; const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); }); it('should render with illustration', () => { const props = baseProps(); props.imgSrc = dialogIllustration; const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); }); it('should render the small variant', () => { const props = baseProps(); props.imgSrc = dialogIllustration; props.size = 'small'; const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); }); it('should render custom content', () => { const props = baseProps(); props.render = () =>