Browse Source

delete some test

pull/11234/head
陈帅 7 years ago
parent
commit
1f25b1042b
  1. 5
      components/drawer/__tests__/Drawer.test.js
  2. 109
      components/drawer/__tests__/__snapshots__/Drawer.test.js.snap

5
components/drawer/__tests__/Drawer.test.js

@ -35,7 +35,7 @@ class DrawerTester extends React.Component {
describe('Drawer', () => {
it('render correctly', () => {
const wrapper = mount(<DrawerTester />);
const wrapper = mount(<DrawerTester width={400} />);
const content = wrapper.find('.ant-drawer-body').getDOMNode().innerHTML;
expect(content).toBe('Here is content of Drawer');
expect(wrapper.render()).toMatchSnapshot();
@ -47,20 +47,17 @@ describe('Drawer', () => {
expect(title).toBe('Test Title');
const closable = wrapper.find('.ant-drawer-close').exists();
expect(closable).toBe(true);
expect(wrapper.render()).toMatchSnapshot();
});
it('closable is false', () => {
const wrapper = mount(<DrawerTester closable={false} />);
const closable = wrapper.find('.ant-drawer-close').exists();
expect(closable).toBe(false);
expect(wrapper.render()).toMatchSnapshot();
});
it('destroyOnClose is true', () => {
const wrapper = mount(<DrawerTester destroyOnClose visible={false} />);
const body = wrapper.find('.ant-drawer-body').exists();
expect(body).toBe(false);
expect(wrapper.render()).toMatchSnapshot();
});
});

109
components/drawer/__tests__/__snapshots__/Drawer.test.js.snap

@ -1,112 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Drawer closable is false 1`] = `
<div>
<div>
<div>
<div
class="ant-drawer ant-drawer-left ant-drawer-open"
>
<div
class="ant-drawer-mask"
/>
<div
class="ant-drawer-content-wrapper"
>
<div
class="ant-drawer-content"
>
<div
style="width: 256px;"
>
<div
class="ant-drawer-body"
>
Here is content of Drawer
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Drawer destroyOnClose is true 1`] = `
<div>
<div>
<div>
<div
class="ant-drawer ant-drawer-left"
>
<div
class="ant-drawer-mask"
/>
<div
class="ant-drawer-content-wrapper"
style="transform: translateX(-100%);"
>
<div
class="ant-drawer-content"
/>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Drawer have a title 1`] = `
<div>
<div>
<div>
<div
class="ant-drawer ant-drawer-left ant-drawer-open"
>
<div
class="ant-drawer-mask"
/>
<div
class="ant-drawer-content-wrapper"
>
<div
class="ant-drawer-content"
>
<div
style="width: 256px;"
>
<div
class="ant-drawer-header"
>
<div
class="ant-drawer-title"
>
Test Title
</div>
</div>
<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>
</div>
`;
exports[`Drawer render correctly 1`] = `
<div>
<div>
@ -124,7 +17,7 @@ exports[`Drawer render correctly 1`] = `
class="ant-drawer-content"
>
<div
style="width: 256px;"
style="width: 400px;"
>
<button
aria-label="Close"

Loading…
Cancel
Save