1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00
awx/__tests__/components/About.test.jsx
kialam b340d49cb7
Integrate proptypes for our shared components.
- Fix unit tests.
- Fix linter errors.
2019-02-15 15:08:52 -05:00

32 lines
851 B
JavaScript

import React from 'react';
import { mount } from 'enzyme';
import { I18nProvider } from '@lingui/react';
import About from '../../src/components/About';
describe('<About />', () => {
let aboutWrapper;
let closeButton;
const onClose = jest.fn();
test('initially renders without crashing', () => {
aboutWrapper = mount(
<I18nProvider>
<About isOpen onClose={onClose} />
</I18nProvider>
);
expect(aboutWrapper.length).toBe(1);
aboutWrapper.unmount();
});
test('close button calls onClose handler', () => {
aboutWrapper = mount(
<I18nProvider>
<About isOpen onClose={onClose} />
</I18nProvider>
);
closeButton = aboutWrapper.find('AboutModalBoxCloseButton Button');
closeButton.simulate('click');
expect(onClose).toBeCalled();
aboutWrapper.unmount();
});
});