From db62ce477d33ddd0e214fb7691f446edf3c1155e Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Mon, 18 Oct 2021 13:51:26 +0100 Subject: [PATCH] A11y/Dashboard: Fix various fastpass issues for dashboard settings (#40335) * A11y/Dashboard: Fix various fastpass issue for dashboard settings See #39429 --- e2e/suite1/specs/select-focus.spec.ts | 6 +++--- public/app/core/components/Select/FolderPicker.tsx | 2 +- .../components/DashboardSettings/AutoRefreshIntervals.tsx | 1 + .../components/DashboardSettings/GeneralSettings.tsx | 5 +++-- .../components/DashboardSettings/LinksSettings.test.tsx | 2 +- .../components/DashboardSettings/TimePickerSettings.tsx | 8 ++++++-- .../components/LinksSettings/LinkSettingsEdit.tsx | 8 +++++++- .../components/LinksSettings/LinkSettingsList.tsx | 6 +++++- 8 files changed, 27 insertions(+), 11 deletions(-) diff --git a/e2e/suite1/specs/select-focus.spec.ts b/e2e/suite1/specs/select-focus.spec.ts index 26bb0f3e879..1a6f2e9ae25 100644 --- a/e2e/suite1/specs/select-focus.spec.ts +++ b/e2e/suite1/specs/select-focus.spec.ts @@ -13,7 +13,7 @@ e2e.scenario({ e2e.components.FolderPicker.container() .should('be.visible') .within(() => { - e2e.components.Select.input().should('be.visible').click(); + e2e().get('#dashboard-folder-input').should('be.visible').click(); }); e2e.components.Select.option().should('be.visible').first().click(); @@ -21,7 +21,7 @@ e2e.scenario({ e2e.components.FolderPicker.container() .should('be.visible') .within(() => { - e2e.components.Select.input().should('exist').should('have.focus'); + e2e().get('#dashboard-folder-input').should('exist').should('have.focus'); }); e2e.pages.Dashboard.Settings.General.title().click(); @@ -29,7 +29,7 @@ e2e.scenario({ e2e.components.FolderPicker.container() .should('be.visible') .within(() => { - e2e.components.Select.input().should('exist').should('not.have.focus'); + e2e().get('#dashboard-folder-input').should('exist').should('not.have.focus'); }); }, }); diff --git a/public/app/core/components/Select/FolderPicker.tsx b/public/app/core/components/Select/FolderPicker.tsx index 35aad433894..fac62a8b3cf 100644 --- a/public/app/core/components/Select/FolderPicker.tsx +++ b/public/app/core/components/Select/FolderPicker.tsx @@ -178,7 +178,6 @@ export class FolderPicker extends PureComponent { { loadOptions={this.debouncedSearch} onChange={this.onFolderChange} onCreateOption={this.createNewFolder} + menuShouldPortal /> ); diff --git a/public/app/features/dashboard/components/DashboardSettings/AutoRefreshIntervals.tsx b/public/app/features/dashboard/components/DashboardSettings/AutoRefreshIntervals.tsx index 891c5607ee9..5554971c657 100644 --- a/public/app/features/dashboard/components/DashboardSettings/AutoRefreshIntervals.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/AutoRefreshIntervals.tsx @@ -63,6 +63,7 @@ export const AutoRefreshIntervals: FC = ({ invalid={!!invalidIntervalsMessage} >
- + - + { expect(getTableBodyRows().length).toBe(links.length); // TODO remove skipPointerEventsCheck once https://github.com/jsdom/jsdom/issues/3232 is fixed - userEvent.click(within(getTableBody()).getAllByRole('button', { name: /delete/i })[0], undefined, { + userEvent.click(within(getTableBody()).getAllByRole('button', { name: 'Delete' })[0], undefined, { skipPointerEventsCheck: true, }); diff --git a/public/app/features/dashboard/components/DashboardSettings/TimePickerSettings.tsx b/public/app/features/dashboard/components/DashboardSettings/TimePickerSettings.tsx index 65a0b5a8fa1..122b4a201e3 100644 --- a/public/app/features/dashboard/components/DashboardSettings/TimePickerSettings.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/TimePickerSettings.tsx @@ -83,13 +83,17 @@ export class TimePickerSettings extends PureComponent { /> - + - + ); diff --git a/public/app/features/dashboard/components/LinksSettings/LinkSettingsEdit.tsx b/public/app/features/dashboard/components/LinksSettings/LinkSettingsEdit.tsx index 02348d9ad11..ac99dca1faf 100644 --- a/public/app/features/dashboard/components/LinksSettings/LinkSettingsEdit.tsx +++ b/public/app/features/dashboard/components/LinksSettings/LinkSettingsEdit.tsx @@ -87,7 +87,13 @@ export const LinkSettingsEdit: React.FC = ({ editLinkIdx, - {linkSettings.type === 'dashboards' && ( <> diff --git a/public/app/features/dashboard/components/LinksSettings/LinkSettingsList.tsx b/public/app/features/dashboard/components/LinksSettings/LinkSettingsList.tsx index f3e1c69d929..f23cedc728b 100644 --- a/public/app/features/dashboard/components/LinksSettings/LinkSettingsList.tsx +++ b/public/app/features/dashboard/components/LinksSettings/LinkSettingsList.tsx @@ -94,7 +94,11 @@ export const LinkSettingsList: React.FC = ({ dashboard, o duplicateLink(link, idx)} /> - deleteLink(idx)} /> + deleteLink(idx)} + /> ))}