mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 04:31:21 -03:30
fix test after rebase of org teams update
This commit is contained in:
parent
344713f938
commit
abc3733449
@ -2,18 +2,11 @@ import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { I18nProvider } from '@lingui/react';
|
||||
<<<<<<< HEAD
|
||||
import { ConfigContext } from '../../../../src/context';
|
||||
import OrganizationForm from '../../../../src/pages/Organizations/components/OrganizationForm';
|
||||
import { sleep } from '../../../testUtils';
|
||||
=======
|
||||
import { ConfigProvider } from '../../../../src/contexts/Config';
|
||||
import { NetworkProvider } from '../../../../src/contexts/Network';
|
||||
import OrganizationForm, { _OrganizationForm } from '../../../../src/pages/Organizations/components/OrganizationForm';
|
||||
|
||||
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
>>>>>>> fix unit tests for network handling
|
||||
|
||||
describe('<OrganizationForm />', () => {
|
||||
let api;
|
||||
let networkProviderValue;
|
||||
|
||||
@ -6,6 +6,7 @@ import { createMemoryHistory } from 'history';
|
||||
import { sleep } from '../../../../testUtils';
|
||||
import OrganizationTeams, { _OrganizationTeams } from '../../../../../src/pages/Organizations/screens/Organization/OrganizationTeams';
|
||||
import OrganizationTeamsList from '../../../../../src/pages/Organizations/components/OrganizationTeamsList';
|
||||
import { NetworkProvider } from '../../../../../src/contexts/Network';
|
||||
|
||||
const listData = {
|
||||
data: {
|
||||
@ -30,6 +31,7 @@ describe('<OrganizationTeams />', () => {
|
||||
api={{
|
||||
readOrganizationTeamsList: jest.fn(),
|
||||
}}
|
||||
handleHttpError={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@ -39,11 +41,14 @@ describe('<OrganizationTeams />', () => {
|
||||
mount(
|
||||
<I18nProvider>
|
||||
<MemoryRouter initialEntries={['/organizations/1']} initialIndex={0}>
|
||||
<OrganizationTeams
|
||||
id={1}
|
||||
searchString=""
|
||||
api={{ readOrganizationTeamsList }}
|
||||
/>
|
||||
<NetworkProvider
|
||||
value={{ api: { readOrganizationTeamsList }, handleHttpError: () => {} }}
|
||||
>
|
||||
<OrganizationTeams
|
||||
id={1}
|
||||
searchString=""
|
||||
/>
|
||||
</NetworkProvider>
|
||||
</MemoryRouter>
|
||||
</I18nProvider>
|
||||
).find('OrganizationTeams');
|
||||
@ -59,11 +64,14 @@ describe('<OrganizationTeams />', () => {
|
||||
const wrapper = mount(
|
||||
<I18nProvider>
|
||||
<MemoryRouter>
|
||||
<OrganizationTeams
|
||||
id={1}
|
||||
searchString=""
|
||||
api={{ readOrganizationTeamsList }}
|
||||
/>
|
||||
<NetworkProvider
|
||||
value={{ api: { readOrganizationTeamsList }, handleHttpError: () => {} }}
|
||||
>
|
||||
<OrganizationTeams
|
||||
id={1}
|
||||
searchString=""
|
||||
/>
|
||||
</NetworkProvider>
|
||||
</MemoryRouter>
|
||||
</I18nProvider>
|
||||
);
|
||||
@ -100,11 +108,14 @@ describe('<OrganizationTeams />', () => {
|
||||
const wrapper = mount(
|
||||
<Router history={history}>
|
||||
<I18nProvider>
|
||||
<OrganizationTeams
|
||||
id={1}
|
||||
searchString=""
|
||||
api={{ readOrganizationTeamsList }}
|
||||
/>
|
||||
<NetworkProvider
|
||||
value={{ api: { readOrganizationTeamsList }, handleHttpError: () => {} }}
|
||||
>
|
||||
<OrganizationTeams
|
||||
id={1}
|
||||
searchString=""
|
||||
/>
|
||||
</NetworkProvider>
|
||||
</I18nProvider>
|
||||
</Router>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user