diff --git a/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx b/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx index f9174222bea..bc3fc975b05 100644 --- a/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx +++ b/public/app/features/alerting/unified/components/AlertRuleDrawerForm.test.tsx @@ -249,6 +249,11 @@ describe('AlertRuleDrawerForm', () => { // Click Create await user.click(screen.getByRole('button', { name: /Create/i })); + // Wait for the execute function to be called + await waitFor(() => { + expect(mockExecute).toHaveBeenCalled(); + }); + // Drawer should close on success await waitFor(() => { expect(onClose).toHaveBeenCalled();