mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-25 21:05:36 +08:00
29 lines
692 B
TypeScript
29 lines
692 B
TypeScript
import React from 'react'
|
|
import { mount, render } from 'enzyme'
|
|
import { Dot } from 'components'
|
|
|
|
describe('Dot', () => {
|
|
it('should render correctly', () => {
|
|
const wrapper = mount(<Dot />)
|
|
expect(wrapper).toMatchSnapshot()
|
|
expect(() => wrapper.unmount()).not.toThrow()
|
|
})
|
|
|
|
it('should supports types', () => {
|
|
const wrapper = render(
|
|
<div>
|
|
<Dot type="success" />
|
|
<Dot type="secondary" />
|
|
<Dot type="warning" />
|
|
<Dot type="error" />
|
|
</div>,
|
|
)
|
|
expect(wrapper).toMatchSnapshot()
|
|
})
|
|
|
|
it('should be render text', () => {
|
|
const wrapper = mount(<Dot>test</Dot>)
|
|
expect(wrapper.text()).toContain('test')
|
|
})
|
|
})
|