maccounter
19 строк · 781.0 Байт
1import Greeting from '@components/Greeting/Greeting'
2import React from 'react'
3import { compareSnapshot } from '@testUtils/renderSnapshot'
4
5describe('Greeting', () => {
6const renderComponent = (period: string) => <Greeting userName="Jack" timePeriod={period} />
7
8// eslint-disable-next-line jest/expect-expect
9it('render morning', () => compareSnapshot(renderComponent('morning')))
10
11// eslint-disable-next-line jest/expect-expect
12it('render afternoon', () => compareSnapshot(renderComponent('afternoon')))
13
14// eslint-disable-next-line jest/expect-expect
15it('render evening', () => compareSnapshot(renderComponent('evening')))
16
17// eslint-disable-next-line jest/expect-expect
18it('render night', () => compareSnapshot(renderComponent('night')))
19})
20