remove snap in destroyOnClose test

This commit is contained in:
陈帅 2018-07-22 01:01:07 +08:00 committed by 偏右
parent 608f631b64
commit cb961cdf01
2 changed files with 4 additions and 81 deletions

View File

@ -90,12 +90,14 @@ describe('Drawer', () => {
it('destroyOnClose is true onClose', () => {
const wrapper = mount(<DrawerEventTester destroyOnClose />);
expect(wrapper.render()).toMatchSnapshot();
wrapper.find('button.ant-btn').simulate('click');
expect(wrapper.find('.ant-drawer-wrapper-body').exists()).toBe(true);
wrapper.setState({
visible: false,
});
wrapper.find('.ant-drawer-wrapper-body').simulate('transitionend');
expect(wrapper.render()).toMatchSnapshot();
expect(wrapper.find('.ant-drawer-wrapper-body').exists()).toBe(false);
});
it('no mask and no closable', () => {

View File

@ -1,84 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Drawer destroyOnClose is true onClose 1`] = `
<div>
<button
class="ant-btn"
type="button"
>
<span>
open
</span>
</button>
<div>
<div
class="ant-drawer ant-drawer-right ant-drawer-open"
>
<div
class="ant-drawer-mask"
/>
<div
class="ant-drawer-content-wrapper"
style="width: 256px;"
>
<div
class="ant-drawer-content"
>
<div
class="ant-drawer-wrapper-body"
style="overflow: auto; height: 100%;"
>
<button
aria-label="Close"
class="ant-drawer-close"
>
<span
class="ant-drawer-close-x"
/>
</button>
<div
class="ant-drawer-body"
>
Here is content of Drawer
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Drawer destroyOnClose is true onClose 2`] = `
<div>
<button
class="ant-btn"
type="button"
>
<span>
open
</span>
</button>
<div>
<div
class="ant-drawer ant-drawer-right"
>
<div
class="ant-drawer-mask"
/>
<div
class="ant-drawer-content-wrapper"
style="width: 256px; transform: translateX(100%);"
>
<div
class="ant-drawer-content"
/>
</div>
</div>
</div>
</div>
`;
exports[`Drawer render correctly 1`] = `
<div>
<button