From 77e99ad3555a5e78b74df74f069598db9c510353 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 26 Mar 2020 12:57:31 -0400 Subject: [PATCH] Adds aria-label to some buttons without text --- .../src/components/JobList/JobListItem.jsx | 6 +++- .../PageHeaderToolbar/PageHeaderToolbar.jsx | 5 ++- .../ScheduleList/ScheduleListItem.jsx | 1 + .../src/components/Sparkline/Sparkline.jsx | 5 ++- .../CredentialList/CredentialListItem.jsx | 1 + .../screens/Host/HostList/HostListItem.jsx | 1 + .../InventoryGroupHostListItem.jsx | 1 + .../InventoryGroups/InventoryGroupItem.jsx | 7 ++++- .../InventoryList/InventoryListItem.jsx | 1 + .../screens/Job/JobOutput/JobOutput.test.jsx | 6 ++-- .../screens/Job/JobOutput/PageControls.jsx | 31 +++++++++++++++---- .../Job/JobOutput/PageControls.test.jsx | 6 ++-- .../Job/JobOutput/shared/OutputToolbar.jsx | 8 +++-- .../OrganizationList/OrganizationListItem.jsx | 1 + .../Project/ProjectList/ProjectListItem.jsx | 2 ++ .../screens/Team/TeamList/TeamListItem.jsx | 1 + .../TemplateList/TemplateListItem.jsx | 2 ++ .../screens/User/UserList/UserListItem.jsx | 1 + 18 files changed, 68 insertions(+), 18 deletions(-) diff --git a/awx/ui_next/src/components/JobList/JobListItem.jsx b/awx/ui_next/src/components/JobList/JobListItem.jsx index b38e85b11e..ea0eb86c3e 100644 --- a/awx/ui_next/src/components/JobList/JobListItem.jsx +++ b/awx/ui_next/src/components/JobList/JobListItem.jsx @@ -81,7 +81,11 @@ function JobListItem({ {({ handleRelaunch }) => ( - )} diff --git a/awx/ui_next/src/components/PageHeaderToolbar/PageHeaderToolbar.jsx b/awx/ui_next/src/components/PageHeaderToolbar/PageHeaderToolbar.jsx index 1adce89e4e..229136c23b 100644 --- a/awx/ui_next/src/components/PageHeaderToolbar/PageHeaderToolbar.jsx +++ b/awx/ui_next/src/components/PageHeaderToolbar/PageHeaderToolbar.jsx @@ -72,7 +72,10 @@ class PageHeaderToolbar extends Component { position={DropdownPosition.right} onSelect={this.handleHelpSelect} toggle={ - + } diff --git a/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleListItem.jsx b/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleListItem.jsx index 758658a950..6e36a73e16 100644 --- a/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleListItem.jsx +++ b/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleListItem.jsx @@ -107,6 +107,7 @@ function ScheduleListItem({ i18n, isSelected, onSelect, schedule }) { {schedule.summary_fields.user_capabilities.edit ? ( diff --git a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx index e83ffb2ef8..7457c43332 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx @@ -72,6 +72,7 @@ class InventoryListItem extends React.Component { {inventory.summary_fields.user_capabilities.edit ? ( - - - ); -export default PageControls; +export default withI18n()(PageControls); diff --git a/awx/ui_next/src/screens/Job/JobOutput/PageControls.test.jsx b/awx/ui_next/src/screens/Job/JobOutput/PageControls.test.jsx index 210c33feb9..86df76448f 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/PageControls.test.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/PageControls.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { mount } from 'enzyme'; +import { mountWithContexts } from '@testUtils/enzymeHelpers'; import PageControls from './PageControls'; let wrapper; @@ -19,12 +19,12 @@ const findChildren = () => { describe('PageControls', () => { test('should render successfully', () => { - wrapper = mount(); + wrapper = mountWithContexts(); expect(wrapper).toHaveLength(1); }); test('should render menu control icons', () => { - wrapper = mount(); + wrapper = mountWithContexts(); findChildren(); expect(PlusIcon.length).toBe(1); expect(AngleDoubleUpIcon.length).toBe(1); diff --git a/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.jsx b/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.jsx index 81e75938bc..c09728c5ae 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.jsx @@ -127,7 +127,11 @@ const OutputToolbar = ({ i18n, job, onDelete }) => { {({ handleRelaunch }) => ( - )} @@ -138,7 +142,7 @@ const OutputToolbar = ({ i18n, job, onDelete }) => { {job.related?.stdout && ( - diff --git a/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationListItem.jsx b/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationListItem.jsx index efcc1edff6..9c1f66ae11 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationListItem.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationListItem.jsx @@ -93,6 +93,7 @@ function OrganizationListItem({ {organization.summary_fields.user_capabilities.edit ? (