mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 10:40:01 -03:30
update components tests to use mountWithContexts when relevant
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { I18nProvider } from '@lingui/react';
|
||||
import { mountWithContexts } from '../enzymeHelpers';
|
||||
import About from '../../src/components/About';
|
||||
|
||||
describe('<About />', () => {
|
||||
@@ -8,20 +7,16 @@ describe('<About />', () => {
|
||||
let closeButton;
|
||||
const onClose = jest.fn();
|
||||
test('initially renders without crashing', () => {
|
||||
aboutWrapper = mount(
|
||||
<I18nProvider>
|
||||
<About isOpen onClose={onClose} />
|
||||
</I18nProvider>
|
||||
aboutWrapper = mountWithContexts(
|
||||
<About isOpen onClose={onClose} />
|
||||
);
|
||||
expect(aboutWrapper.length).toBe(1);
|
||||
aboutWrapper.unmount();
|
||||
});
|
||||
|
||||
test('close button calls onClose handler', () => {
|
||||
aboutWrapper = mount(
|
||||
<I18nProvider>
|
||||
<About isOpen onClose={onClose} />
|
||||
</I18nProvider>
|
||||
aboutWrapper = mountWithContexts(
|
||||
<About isOpen onClose={onClose} />
|
||||
);
|
||||
closeButton = aboutWrapper.find('AboutModalBoxCloseButton Button');
|
||||
closeButton.simulate('click');
|
||||
|
||||
Reference in New Issue
Block a user