Files
react/components/spinner/__tests__/index.test.tsx
2020-04-25 00:01:57 +08:00

25 lines
646 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()
})
})