Frontend: Migrate PageToolbar.tsx from aria-label e2e selectors to data-testid (#79663)

* refactor: update PageToolbar to use data-testid

* refactor: update selector text

---------

Co-authored-by: joshhunt <josh@trtr.co>
This commit is contained in:
Jamin 2024-01-04 11:52:38 +00:00 committed by GitHub
parent 5154a9d99c
commit 576b8ccff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -656,9 +656,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
],
"packages/grafana-ui/src/components/PageLayout/PageToolbar.tsx:5381": [
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
],
"packages/grafana-ui/src/components/PanelChrome/LoadingIndicator.tsx:5381": [
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
],

View File

@ -287,7 +287,7 @@ export const Components = {
button: (title: string) => `QueryEditor toolbar item button ${title}`,
},
BackButton: {
backArrow: 'Go Back',
backArrow: 'data-testid Go Back',
},
OptionsGroup: {
group: (title?: string) => (title ? `Options group ${title}` : 'Options group'),

View File

@ -92,7 +92,7 @@ export const PageToolbar = React.memo(
tooltip="Go back (Esc)"
tooltipPlacement="bottom"
size="xxl"
aria-label={selectors.components.BackButton.backArrow}
data-testid={selectors.components.BackButton.backArrow}
onClick={onGoBack}
/>
</div>