From 74c656713adf464944b5d00c20c668f269651691 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Mon, 8 Dec 2025 17:07:46 +0000 Subject: [PATCH] "fix" SendResetMailPage tests --- .../core/components/ForgottenPassword/ForgottenPassword.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx b/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx index b40692f6a87..efc2e7e25d4 100644 --- a/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx +++ b/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx @@ -1,5 +1,6 @@ import { css } from '@emotion/css'; import { useState } from 'react'; +import { flushSync } from 'react-dom'; import { useForm } from 'react-hook-form'; import { GrafanaTheme2 } from '@grafana/data'; @@ -34,7 +35,10 @@ export const ForgottenPassword = () => { const sendEmail = async (formModel: EmailDTO) => { const res = await getBackendSrv().post('/api/user/password/send-reset-email', formModel); if (res) { - setEmailSent(true); + // TODO why? + flushSync(() => { + setEmailSent(true); + }); } };