diff --git a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.test.jsx b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.test.jsx index 340207ab9c..53506930fc 100644 --- a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.test.jsx +++ b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.test.jsx @@ -76,6 +76,7 @@ describe('', () => { beforeAll(() => { const readOnlyHost = { ...mockHost }; readOnlyHost.summary_fields.user_capabilities.edit = false; + readOnlyHost.summary_fields.recent_jobs = []; wrapper = mountWithContexts(); }); @@ -84,6 +85,12 @@ describe('', () => { wrapper.unmount(); }); + test('should hide activity stream when there are no recent jobs', async () => { + expect(wrapper.find(`Detail[label="Activity"] Sparkline`)).toHaveLength( + 0 + ); + }); + test('should hide edit button for users without edit permission', async () => { expect(wrapper.find('Button[aria-label="edit"]').length).toBe(0); }); diff --git a/awx/ui_next/src/screens/Inventory/Inventories.jsx b/awx/ui_next/src/screens/Inventory/Inventories.jsx index bf793860e1..0ad93adbe9 100644 --- a/awx/ui_next/src/screens/Inventory/Inventories.jsx +++ b/awx/ui_next/src/screens/Inventory/Inventories.jsx @@ -50,7 +50,7 @@ function Inventories({ i18n }) { [`${inventoryHostsPath}/${nested?.id}`]: `${nested?.name}`, [`${inventoryHostsPath}/${nested?.id}/edit`]: i18n._(t`Edit details`), [`${inventoryHostsPath}/${nested?.id}/details`]: i18n._( - t`Host Details` + t`Host details` ), [`${inventoryHostsPath}/${nested?.id}/completed_jobs`]: i18n._( t`Completed jobs` @@ -80,7 +80,7 @@ function Inventories({ i18n }) { ), [`${inventorySourcesPath}/${nested?.id}/schedules/${schedule?.id}`]: `${schedule?.name}`, [`${inventorySourcesPath}/${nested?.id}/schedules/${schedule?.id}/details`]: i18n._( - t`Schedule Details` + t`Schedule details` ), }); }, diff --git a/awx/ui_next/src/screens/Inventory/InventoryHostDetail/InventoryHostDetail.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryHostDetail/InventoryHostDetail.test.jsx index de5fa022a2..ae7d60b1f7 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHostDetail/InventoryHostDetail.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHostDetail/InventoryHostDetail.test.jsx @@ -79,6 +79,7 @@ describe('', () => { beforeAll(() => { const readOnlyHost = { ...mockHost }; readOnlyHost.summary_fields.user_capabilities.edit = false; + readOnlyHost.summary_fields.recent_jobs = []; wrapper = mountWithContexts(); }); @@ -87,6 +88,12 @@ describe('', () => { wrapper.unmount(); }); + test('should hide activity stream when there are no recent jobs', async () => { + expect(wrapper.find(`Detail[label="Activity"] Sparkline`)).toHaveLength( + 0 + ); + }); + test('should hide edit button for users without edit permission', async () => { expect(wrapper.find('Button[aria-label="edit"]').length).toBe(0); });