mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -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 ExpandCollapse from '../../src/components/ExpandCollapse';
|
||||
|
||||
describe('<ExpandCollapse />', () => {
|
||||
@@ -8,14 +7,12 @@ describe('<ExpandCollapse />', () => {
|
||||
const onExpand = jest.fn();
|
||||
const isCompact = false;
|
||||
test('initially renders without crashing', () => {
|
||||
const wrapper = mount(
|
||||
<I18nProvider>
|
||||
<ExpandCollapse
|
||||
onCompact={onCompact}
|
||||
onExpand={onExpand}
|
||||
isCompact={isCompact}
|
||||
/>
|
||||
</I18nProvider>
|
||||
const wrapper = mountWithContexts(
|
||||
<ExpandCollapse
|
||||
onCompact={onCompact}
|
||||
onExpand={onExpand}
|
||||
isCompact={isCompact}
|
||||
/>
|
||||
);
|
||||
expect(wrapper.length).toBe(1);
|
||||
wrapper.unmount();
|
||||
|
||||
Reference in New Issue
Block a user