2019-01-23 10:41:07 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { mount } from 'enzyme';
|
|
|
|
import Collapse from '..';
|
|
|
|
|
|
|
|
describe('Collapse', () => {
|
|
|
|
it('should support remove expandIcon', () => {
|
|
|
|
const wrapper = mount(
|
|
|
|
<Collapse expandIcon={() => null}>
|
|
|
|
<Collapse.Panel header="header" />
|
2019-03-06 13:45:40 +08:00
|
|
|
</Collapse>,
|
2019-01-23 10:41:07 +08:00
|
|
|
);
|
|
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
|
|
});
|
2019-02-13 19:32:49 +08:00
|
|
|
|
|
|
|
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>} />
|
2019-03-06 13:45:40 +08:00
|
|
|
</Collapse>,
|
2019-02-13 19:32:49 +08:00
|
|
|
);
|
|
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
|
|
});
|
2019-01-23 10:41:07 +08:00
|
|
|
});
|