From 66d6491d2e75bac88055569e301b95458d4d45f2 Mon Sep 17 00:00:00 2001 From: simeng-li Date: Tue, 28 Nov 2023 11:20:33 +0800 Subject: [PATCH] fix(experience): use absolute path for password sign-in form nav (#4973) should use absolute path for the password sign-in form navigation --- .../pages/SignIn/IdentifierSignInForm/index.test.tsx | 10 +++++----- .../pages/SignIn/IdentifierSignInForm/use-on-submit.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/experience/src/pages/SignIn/IdentifierSignInForm/index.test.tsx b/packages/experience/src/pages/SignIn/IdentifierSignInForm/index.test.tsx index 11c7b6c88..2a94658ee 100644 --- a/packages/experience/src/pages/SignIn/IdentifierSignInForm/index.test.tsx +++ b/packages/experience/src/pages/SignIn/IdentifierSignInForm/index.test.tsx @@ -127,7 +127,7 @@ describe('IdentifierSignInForm', () => { await waitFor(() => { expect(sendVerificationCodeApi).not.toBeCalled(); expect(mockedNavigate).toBeCalledWith( - { pathname: 'password' }, + { pathname: '/sign-in/password' }, { state: { identifier: SignInIdentifier.Username, value } } ); }); @@ -145,7 +145,7 @@ describe('IdentifierSignInForm', () => { await waitFor(() => { expect(sendVerificationCodeApi).not.toBeCalled(); expect(mockedNavigate).toBeCalledWith( - { pathname: 'password' }, + { pathname: '/sign-in/password' }, { state: { identifier, @@ -199,7 +199,7 @@ describe('IdentifierSignInForm', () => { await waitFor(() => { expect(getSingleSignOnConnectorsMock).not.toBeCalled(); expect(mockedNavigate).toBeCalledWith( - { pathname: 'password' }, + { pathname: '/sign-in/password' }, { state: { identifier: SignInIdentifier.Username, value: username } } ); }); @@ -224,7 +224,7 @@ describe('IdentifierSignInForm', () => { await waitFor(() => { expect(getSingleSignOnConnectorsMock).not.toBeCalled(); expect(mockedNavigate).toBeCalledWith( - { pathname: 'password' }, + { pathname: '/sign-in/password' }, { state: { identifier: SignInIdentifier.Email, value: email } } ); }); @@ -254,7 +254,7 @@ describe('IdentifierSignInForm', () => { await waitFor(() => { expect(getSingleSignOnConnectorsMock).toBeCalled(); expect(mockedNavigate).toBeCalledWith( - { pathname: 'password' }, + { pathname: '/sign-in/password' }, { state: { identifier: SignInIdentifier.Email, value: email } } ); }); diff --git a/packages/experience/src/pages/SignIn/IdentifierSignInForm/use-on-submit.ts b/packages/experience/src/pages/SignIn/IdentifierSignInForm/use-on-submit.ts index df182689b..5b1af59b4 100644 --- a/packages/experience/src/pages/SignIn/IdentifierSignInForm/use-on-submit.ts +++ b/packages/experience/src/pages/SignIn/IdentifierSignInForm/use-on-submit.ts @@ -17,7 +17,7 @@ const useOnSubmit = (signInMethods: SignIn['methods']) => { (identifier: SignInIdentifier, value: string) => { navigate( { - pathname: 'password', + pathname: `/${UserFlow.SignIn}/password`, }, { state: { identifier, value } } );