-
Notifications
You must be signed in to change notification settings - Fork 937
test(site): move users page test to storybook #14579
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
Conversation
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.
Love to see tests replaced with Storybook!
@@ -0,0 +1,577 @@ | |||
import type { LoginType, User, UserStatus } from "api/typesGenerated"; |
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.
Should we replace all the emails with fake ones? Some of these are probably real (the Coder ones at least, maybe the ones from ChatGPT too).
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.
Ah, sorry, I thought I had removed all of them. 🤦
// These values were retrieved from the Coder API. Sensitive information such as | ||
// usernames, names, and emails has been replaced with fake user data to protect | ||
// privacy. This user data comes from the MockUsers to keep consistency. | ||
export const MockGroups: Group[] = [ |
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.
Should we replace/remove the ones with external avatar URLs? Could be weird if our tests are making requests for these external jpgs and such
await user.click( | ||
within(userRow).getByLabelText("Auditor", { exact: false }), | ||
); | ||
await within(document.body).findByText("Error updating the user roles."); |
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.
Looks like the error text is Error on updating the user roles.
By using Storybook interaction tests, we improve the developer experience, as we can see what is happening in the browser, use browser tools to debug, and snapshot the component after interactions, making our tests more reliable and easier to maintain.
Fixes #14535