From 7379cfe4bde80155a082a30ac1350caea5f0d67b Mon Sep 17 00:00:00 2001 From: simeng-li Date: Mon, 20 Nov 2023 18:49:49 +0800 Subject: [PATCH] fix(experience): fix the ut randomly fail issue (#4913) fix the ut randomly fail issue --- .../SignIn/PasswordSignInForm/index.test.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/experience/src/pages/SignIn/PasswordSignInForm/index.test.tsx b/packages/experience/src/pages/SignIn/PasswordSignInForm/index.test.tsx index 503cecfcd..cf0f65bc2 100644 --- a/packages/experience/src/pages/SignIn/PasswordSignInForm/index.test.tsx +++ b/packages/experience/src/pages/SignIn/PasswordSignInForm/index.test.tsx @@ -169,15 +169,13 @@ describe('UsernamePasswordSignInForm', () => { fireEvent.submit(submitButton); }); - act(() => { - void waitFor(() => { - expect(signInWithPasswordIdentifier).toBeCalledWith({ - [type]: - type === SignInIdentifier.Phone - ? `${getDefaultCountryCallingCode()}${identifier}` - : identifier, - password: 'password', - }); + await waitFor(() => { + expect(signInWithPasswordIdentifier).toBeCalledWith({ + [type]: + type === SignInIdentifier.Phone + ? `${getDefaultCountryCallingCode()}${identifier}` + : identifier, + password: 'password', }); }); });