-
Notifications
You must be signed in to change notification settings - Fork 164
Fix switching identity in dashboard. #3484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix switching identity in dashboard. #3484
Conversation
lmuntaner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the E2E test!
Minor comment only, already approving.
| const handleSignIn = async (identityNumber: bigint) => { | ||
| lastUsedIdentitiesStore.selectIdentity(identityNumber); | ||
| await gotoManage(); | ||
| const switchedToIdentity = async (identityNumber: bigint) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why switched and not switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this method is technically called after the user has already authenticated with another identity, thus switched identity.
For example it's called in handleSwitchIdentity after authentication with the next identity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But since we're calling.selectIdentity() in this method, switch might actually read better than switched.
| await expect(passkey).toHaveCount(1); | ||
| }); | ||
|
|
||
| test("User can switch between identities", async ({ page }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Fix switching identity in dashboard.
Changes
gotoManagemethod withswitchedToIdentitymethod.$lastUsedIdentitiesStore.identitiesis astring, so usingtoStringinstead inhandleSwitchIdentity.Tests
Added e2e test to make sure page data is updated when identity is switched.