diff --git a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.jsx b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.jsx
index a8a7873d6b..a94215dcd0 100644
--- a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.jsx
+++ b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.jsx
@@ -30,7 +30,9 @@ function OrganizationTeams({ id, i18n }) {
data: { count = 0, results = [] },
} = await OrganizationsAPI.readTeams(id, params);
setItemCount(count);
- setTeams(results);
+ setTeams(
+ results.map(team => ({ ...team, url: `/teams/${team.id}/details` }))
+ );
} catch (error) {
setContentError(error);
} finally {
diff --git a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx
index 22e9b988a3..fbc5b48a59 100644
--- a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx
+++ b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import { act } from 'react-dom/test-utils';
import { OrganizationsAPI } from '@api';
-import { mountWithContexts } from '@testUtils/enzymeHelpers';
+import { mountWithContexts, waitForElement } from '@testUtils/enzymeHelpers';
import { sleep } from '@testUtils/testUtils';
import OrganizationTeams from './OrganizationTeams';
@@ -65,7 +65,9 @@ describe('', () => {
wrapper.update();
const list = wrapper.find('PaginatedDataList');
- expect(list.prop('items')).toEqual(listData.data.results);
+ list.find('DataListCell').forEach((el, index) => {
+ expect(el.text()).toBe(listData.data.results[index].name);
+ });
expect(list.prop('itemCount')).toEqual(listData.data.count);
expect(list.prop('qsConfig')).toEqual({
namespace: 'team',
@@ -78,4 +80,15 @@ describe('', () => {
integerFields: ['page', 'page_size'],
});
});
+
+ test('should show content error for failed instance group fetch', async () => {
+ OrganizationsAPI.readTeams.mockImplementationOnce(() =>
+ Promise.reject(new Error())
+ );
+ let wrapper;
+ await act(async () => {
+ wrapper = mountWithContexts();
+ });
+ await waitForElement(wrapper, 'ContentError', el => el.length === 1);
+ });
});