ant-design/components/drawer/__tests__/Drawer.test.js
2018-07-22 11:55:46 +08:00

58 lines
1.1 KiB
JavaScript

import React from 'react';
import { render } from 'enzyme';
import Drawer from '..';
describe('Drawer', () => {
it('render correctly', () => {
const wrapper = render(
<Drawer
visible
width={400}
getContainer={false}
>
Here is content of Drawer
</Drawer>
);
expect(wrapper).toMatchSnapshot();
});
it('have a title', () => {
const wrapper = render(
<Drawer
visible
title="Test Title"
getContainer={false}
>
Here is content of Drawer
</Drawer>
);
expect(wrapper).toMatchSnapshot();
});
it('closable is false', () => {
const wrapper = render(
<Drawer
visible
closable={false}
getContainer={false}
>
Here is content of Drawer
</Drawer>
);
expect(wrapper).toMatchSnapshot();
});
it('destroyOnClose is true', () => {
const wrapper = render(
<Drawer
destroyOnClose
visible={false}
getContainer={false}
>
Here is content of Drawer
</Drawer>
);
expect(wrapper).toMatchSnapshot();
});
});