mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-28 20:25:29 +08:00
25 lines
645 B
TypeScript
25 lines
645 B
TypeScript
import React from 'react'
|
|
import { mount } from 'enzyme'
|
|
import { Spinner } from 'components'
|
|
|
|
describe('Spacer', () => {
|
|
it('should render correctly', () => {
|
|
const wrapper = mount(<Spinner />)
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
expect(() => wrapper.unmount()).not.toThrow()
|
|
})
|
|
|
|
it('should work with different sizes', () => {
|
|
const wrapper = mount(
|
|
<div>
|
|
<Spinner size="mini" />
|
|
<Spinner size="small" />
|
|
<Spinner size="medium" />
|
|
<Spinner size="large" />
|
|
</div>,
|
|
)
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
expect(() => wrapper.unmount()).not.toThrow()
|
|
})
|
|
})
|