mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Migrate from aria-label e2e selectors to data-testid (#78437)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
This commit is contained in:
parent
6708848056
commit
b7c74a1af6
@ -1634,8 +1634,7 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"public/app/features/alerting/AlertTab.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/alerting/AlertTabCtrl.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -1769,10 +1768,9 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
],
|
||||
"public/app/features/alerting/unified/PanelAlertTabContent.tsx:5381": [
|
||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "1"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "2"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "3"]
|
||||
[0, 0, 0, "Styles should be written using objects.", "2"]
|
||||
],
|
||||
"public/app/features/alerting/unified/RedirectToRuleViewer.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||
@ -2344,11 +2342,10 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Styles should be written using objects.", "1"]
|
||||
],
|
||||
"public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx:5381": [
|
||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "1"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "2"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "3"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "4"]
|
||||
[0, 0, 0, "Styles should be written using objects.", "3"]
|
||||
],
|
||||
"public/app/features/alerting/unified/components/rule-editor/rule-types/RuleType.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||
|
@ -214,7 +214,7 @@ export const Components = {
|
||||
container: (refId: string) => `Query editor row ${refId}`,
|
||||
},
|
||||
AlertTab: {
|
||||
content: 'Alert editor tab content',
|
||||
content: 'data-testid Alert editor tab content',
|
||||
},
|
||||
Alert: {
|
||||
/**
|
||||
@ -405,7 +405,7 @@ export const Components = {
|
||||
submit: 'data-testid-import-dashboard-submit',
|
||||
},
|
||||
PanelAlertTabContent: {
|
||||
content: 'Unified alert editor tab content',
|
||||
content: 'data-testid Unified alert editor tab content',
|
||||
},
|
||||
VisualizationPreview: {
|
||||
card: (name: string) => `data-testid suggestion-${name}`,
|
||||
|
@ -229,7 +229,7 @@ class UnConnectedAlertTab extends PureComponent<Props, State> {
|
||||
<>
|
||||
<CustomScrollbar autoHeightMin="100%">
|
||||
<Container padding="md">
|
||||
<div aria-label={selectors.components.AlertTab.content}>
|
||||
<div data-testid={selectors.components.AlertTab.content}>
|
||||
{alert && hasTransformations && (
|
||||
<Alert
|
||||
severity={AppNotificationSeverity.Error}
|
||||
|
@ -59,7 +59,7 @@ export const PanelAlertTabContent = ({ dashboard, panel }: Props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div aria-label={selectors.components.PanelAlertTabContent.content} className={styles.noRulesWrapper}>
|
||||
<div data-testid={selectors.components.PanelAlertTabContent.content} className={styles.noRulesWrapper}>
|
||||
{alert}
|
||||
{!!dashboard.uid && (
|
||||
<>
|
||||
|
@ -457,7 +457,7 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P
|
||||
dispatch(addNewDataQuery());
|
||||
}}
|
||||
variant="secondary"
|
||||
aria-label={selectors.components.QueryTab.addQuery}
|
||||
data-testid={selectors.components.QueryTab.addQuery}
|
||||
disabled={noCompatibleDataSources}
|
||||
className={styles.addQueryButton}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user