mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-28 20:25:29 +08:00
28 lines
792 B
TypeScript
28 lines
792 B
TypeScript
import React from 'react'
|
|
import { mount } from 'enzyme'
|
|
import { Card } from 'components'
|
|
|
|
describe('Card Footer', () => {
|
|
it('should render correctly', () => {
|
|
const wrapper = mount(
|
|
<Card>
|
|
<p>card</p>
|
|
<Card.Footer>footer</Card.Footer>
|
|
</Card>,
|
|
)
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
expect(() => wrapper.unmount()).not.toThrow()
|
|
})
|
|
|
|
it('should work properly when use alone', () => {
|
|
const wrapper = mount(<Card.Footer>footer</Card.Footer>)
|
|
expect(() => wrapper.unmount()).not.toThrow()
|
|
})
|
|
|
|
it('should work with disable-auto-margin', () => {
|
|
const wrapper = mount(<Card.Footer disableAutoMargin>footer</Card.Footer>)
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
expect(() => wrapper.unmount()).not.toThrow()
|
|
})
|
|
})
|