From c39423d5ca085907c3d1a4a4eb8ae92ea04b6bbb Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Tue, 28 Apr 2020 16:26:46 -0400 Subject: [PATCH] Fixes failing test --- .../InventoryHostGroups.test.jsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroups.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroups.test.jsx index 9ee649b1f2..fff99cddaf 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroups.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroups.test.jsx @@ -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('', () => { test('initially renders successfully', async () => {