diff --git a/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx b/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx index bc3fc975b05..5ab2768f77f 100644 --- a/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx +++ b/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx @@ -240,11 +240,25 @@ describe('AlertRuleDrawerForm', () => { }; mockExecute.mockResolvedValue(mockResponse); - renderDrawer({ onClose }); + // Prefill with required fields (folder and group are required for form submission) + const prefill: Partial = { + name: 'Test Alert Rule', + folder: { title: 'Test Folder', uid: 'test-folder-uid' }, + group: 'test-group', + evaluateEvery: '1m', + type: RuleFormType.grafana, + queries: [ + { + refId: 'A', + datasourceUid: 'test-ds', + queryType: '', + model: { refId: 'A' }, + }, + ], + condition: 'A', + }; - // Fill in required field - const nameInput = screen.getByLabelText(/Name/i); - await user.type(nameInput, 'Test Alert Rule'); + renderDrawer({ onClose, prefill }); // Click Create await user.click(screen.getByRole('button', { name: /Create/i })); @@ -264,7 +278,7 @@ describe('AlertRuleDrawerForm', () => { const user = userEvent.setup(); renderDrawer(); - // Try to submit without filling required fields (name is required) + // Try to submit without filling required fields (name, folder, group are required) await user.click(screen.getByRole('button', { name: /Create/i })); await waitFor(() => { diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index f839ea3d105..1aea6b30041 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -2810,6 +2810,9 @@ }, "simple-condition-editor": { "aria-label-reducer": "Select reducer function", + "aria-label-threshold": "Threshold value", + "aria-label-threshold-from": "Threshold from value", + "aria-label-threshold-to": "Threshold to value", "label-of-query": "OF QUERY", "label-when": "WHEN", "label-when-query": "WHEN QUERY"