Accessibility: Corrected aria-label for Edit Panel (#67185)

* Accessibility: Corrected aria-label for Edit Panel

* Added data-testid

* Added data-testid

* Added betterer results
This commit is contained in:
Khushi Jain 2023-05-17 20:50:38 +05:30 committed by GitHub
parent e27e71ee59
commit 416e347e70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -2218,10 +2218,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"], [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"] [0, 0, 0, "Do not use any type assertions.", "3"]
], ],
"public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx:5381": [
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"],
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"]
],
"public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx:5381": [ "public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx:5381": [
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"] [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
], ],

View File

@ -141,8 +141,8 @@ export const Components = {
content: 'Panel editor data pane content', content: 'Panel editor data pane content',
}, },
applyButton: 'data-testid Apply changes and go back to dashboard', applyButton: 'data-testid Apply changes and go back to dashboard',
toggleVizPicker: 'toggle-viz-picker', toggleVizPicker: 'data-testid toggle-viz-picker',
toggleVizOptions: 'toggle-viz-options', toggleVizOptions: 'data-testid toggle-viz-options',
toggleTableView: 'toggle-table-view', toggleTableView: 'toggle-table-view',
// [Geomap] Map controls // [Geomap] Map controls

View File

@ -42,7 +42,8 @@ export const VisualizationButton = ({ panel }: Props) => {
imgSrc={plugin.meta.info.logos.small} imgSrc={plugin.meta.info.logos.small}
isOpen={isVizPickerOpen} isOpen={isVizPickerOpen}
onClick={onToggleOpen} onClick={onToggleOpen}
aria-label={selectors.components.PanelEditor.toggleVizPicker} data-testid={selectors.components.PanelEditor.toggleVizPicker}
aria-label="Change Visualization"
variant="canvas" variant="canvas"
fullWidth fullWidth
> >
@ -53,7 +54,8 @@ export const VisualizationButton = ({ panel }: Props) => {
icon={isPanelOptionsVisible ? 'angle-right' : 'angle-left'} icon={isPanelOptionsVisible ? 'angle-right' : 'angle-left'}
onClick={onToggleOptionsPane} onClick={onToggleOptionsPane}
variant="canvas" variant="canvas"
aria-label={selectors.components.PanelEditor.toggleVizOptions} data-testid={selectors.components.PanelEditor.toggleVizOptions}
aria-label={isPanelOptionsVisible ? 'Close options pane' : 'Show options pane'}
/> />
</ButtonGroup> </ButtonGroup>
</div> </div>