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