mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
A11y: Update buttons in Explore page to not use HTML Title for tooltip (#53894)
This commit is contained in:
@@ -26,7 +26,7 @@ export const QueryOperationAction: React.FC<QueryOperationActionProps> = ({
|
|||||||
<div className={cx(styles.icon, active && styles.active)}>
|
<div className={cx(styles.icon, active && styles.active)}>
|
||||||
<IconButton
|
<IconButton
|
||||||
name={icon}
|
name={icon}
|
||||||
title={title}
|
tooltip={title}
|
||||||
className={styles.icon}
|
className={styles.icon}
|
||||||
disabled={!!disabled}
|
disabled={!!disabled}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
|
|||||||
@@ -155,11 +155,11 @@ class UnConnectedExploreToolbar extends PureComponent<Props> {
|
|||||||
>
|
>
|
||||||
<ToolbarButtonRow>
|
<ToolbarButtonRow>
|
||||||
{!splitted ? (
|
{!splitted ? (
|
||||||
<ToolbarButton title="Split" onClick={() => split()} icon="columns" disabled={isLive}>
|
<ToolbarButton tooltip="Split the pane" onClick={() => split()} icon="columns" disabled={isLive}>
|
||||||
Split
|
Split
|
||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
) : (
|
) : (
|
||||||
<ToolbarButton title="Close split pane" onClick={() => closeSplit(exploreId)} icon="times">
|
<ToolbarButton tooltip="Close split pane" onClick={() => closeSplit(exploreId)} icon="times">
|
||||||
Close
|
Close
|
||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ describe('Explore QueryRows', () => {
|
|||||||
// waiting for the d&d component to fully render.
|
// waiting for the d&d component to fully render.
|
||||||
await screen.findAllByText('someDs query editor');
|
await screen.findAllByText('someDs query editor');
|
||||||
|
|
||||||
let duplicateButton = screen.getByTitle('Duplicate query');
|
let duplicateButton = screen.getByLabelText(/Duplicate query/i);
|
||||||
|
|
||||||
fireEvent.click(duplicateButton);
|
fireEvent.click(duplicateButton);
|
||||||
|
|
||||||
|
|||||||
@@ -211,17 +211,17 @@ describe('Wrapper', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can close a pane from a split', async () => {
|
it('can close a panel from a split', async () => {
|
||||||
const urlParams = {
|
const urlParams = {
|
||||||
left: JSON.stringify(['now-1h', 'now', 'loki', { refId: 'A' }]),
|
left: JSON.stringify(['now-1h', 'now', 'loki', { refId: 'A' }]),
|
||||||
right: JSON.stringify(['now-1h', 'now', 'elastic', { refId: 'A' }]),
|
right: JSON.stringify(['now-1h', 'now', 'elastic', { refId: 'A' }]),
|
||||||
};
|
};
|
||||||
setupExplore({ urlParams });
|
setupExplore({ urlParams });
|
||||||
const closeButtons = await screen.findAllByTitle(/Close split pane/i);
|
const closeButtons = await screen.findAllByLabelText(/Close split pane/i);
|
||||||
await userEvent.click(closeButtons[1]);
|
await userEvent.click(closeButtons[1]);
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
const logsPanels = screen.queryAllByTitle(/Close split pane/i);
|
const logsPanels = screen.queryAllByLabelText(/Close split pane/i);
|
||||||
expect(logsPanels.length).toBe(0);
|
expect(logsPanels.length).toBe(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user