You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.5 KiB

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