Skip to content

Commit

Permalink
Frontend: Migrate PageToolbar.tsx from aria-label e2e selectors to …
Browse files Browse the repository at this point in the history
…data-testid (grafana#79663)

* refactor: update PageToolbar to use data-testid

* refactor: update selector text

---------

Co-authored-by: joshhunt <[email protected]>
  • Loading branch information
codejagaban and joshhunt authored Jan 4, 2024
1 parent 5154a9d commit 576b8cc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .betterer.results
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
],
Expand Down
2 changes: 1 addition & 1 deletion packages/grafana-e2e-selectors/src/selectors/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 576b8cc

Please sign in to comment.