mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 06:09:34 +08:00
28 lines
794 B
JavaScript
28 lines
794 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import Collapse from '..';
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
|
|
describe('Collapse', () => {
|
|
mountTest(Collapse);
|
|
|
|
it('should support remove expandIcon', () => {
|
|
const wrapper = mount(
|
|
<Collapse expandIcon={() => null}>
|
|
<Collapse.Panel header="header" />
|
|
</Collapse>,
|
|
);
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
});
|
|
|
|
it('should render extra node of panel', () => {
|
|
const wrapper = mount(
|
|
<Collapse>
|
|
<Collapse.Panel header="header" extra={<button type="button">action</button>} />
|
|
<Collapse.Panel header="header" extra={<button type="button">action</button>} />
|
|
</Collapse>,
|
|
);
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
});
|
|
});
|