Merge pull request #6867 from AlexSCorey/TestDebug

Fixes failing test

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-04-28 23:18:33 +00:00 committed by GitHub
commit c5dc03d4a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,9 +2,27 @@ import React from 'react';
import { mountWithContexts } from '@testUtils/enzymeHelpers';
import { act } from 'react-dom/test-utils';
import { createMemoryHistory } from 'history';
import { HostsAPI } from '@api';
import InventoryHostGroups from './InventoryHostGroups';
jest.mock('@api');
HostsAPI.readAllGroups.mockResolvedValue({
data: {
count: 1,
results: [
{
id: 1,
url: 'www.google.com',
summary_fields: {
inventory: { id: 1, name: 'foo' },
user_capabilities: { edit: true },
},
name: 'Bar',
},
],
},
});
HostsAPI.readGroupsOptions.mockResolvedValue({ data: { actions: {} } });
describe('<InventoryHostGroups />', () => {
test('initially renders successfully', async () => {