mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-27 19:25:05 +08:00
test(spinner): add testcase
This commit is contained in:
4879
components/spinner/__tests__/__snapshots__/index.test.tsx.snap
Normal file
4879
components/spinner/__tests__/__snapshots__/index.test.tsx.snap
Normal file
File diff suppressed because it is too large
Load Diff
24
components/spinner/__tests__/index.test.tsx
Normal file
24
components/spinner/__tests__/index.test.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
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()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user