From 1596acbd3b53f59f9498426121acd3665f548dd9 Mon Sep 17 00:00:00 2001 From: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:55:01 +0200 Subject: [PATCH] Alerting: Add data-testids for Fullstory (#94555) * add data-testids for Fullstory * add more data-testids --- .../unified/components/rule-editor/NotificationsStep.tsx | 1 + .../unified/components/rule-editor/RuleEditorSection.tsx | 6 +++++- .../rule-editor/alert-rule-form/AlertRuleForm.tsx | 2 ++ .../components/rule-editor/labels/LabelsFieldInForm.tsx | 9 ++++++++- .../QueryAndExpressionsStep.tsx | 2 +- .../query-and-alert-condition/SmartAlertTypeDetector.tsx | 3 ++- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx index 3a780463010..c7694e69519 100644 --- a/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/NotificationsStep.tsx @@ -143,6 +143,7 @@ function ManualAndAutomaticRouting({ alertUid }: { alertUid?: string }) { { switchMode.setAdvancedMode(event.currentTarget.checked); diff --git a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx index a22616ff227..046e1387429 100644 --- a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx @@ -236,6 +236,7 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => { {existing && ( )} diff --git a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx index 535f13d37f4..085df8a30e5 100644 --- a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx @@ -718,7 +718,7 @@ function TypeSelectorButton({ onClickType }: { onClickType: (type: ExpressionQue return ( - diff --git a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx index b1f83b217aa..cc9bd6a8241 100644 --- a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx @@ -2,7 +2,7 @@ import { useFormContext } from 'react-hook-form'; import { DataSourceInstanceSettings } from '@grafana/data'; import { DataSourceJsonData } from '@grafana/schema'; -import { RadioButtonGroup, Text, Stack } from '@grafana/ui'; +import { RadioButtonGroup, Stack, Text } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { ExpressionDatasourceUID } from 'app/features/expressions/types'; import { AccessControlAction } from 'app/types'; @@ -133,6 +133,7 @@ export function SmartAlertTypeDetector({ disabledOptions={disabledOptions} value={ruleFormType} onChange={onClickSwitch} + data-testid="rule-type-radio-group" /> {/* editing an existing rule, we just show "cannot be changed" */} {editingExistingRule && (