-
Notifications
You must be signed in to change notification settings - Fork 0
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
More tests for index page #14
base: master
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Failures
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@catcatchong The functional testing is still failed, please fix it before requesting another review. |
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.
I did ask for a change in testing. It's better if you can use aria-
tags to identify the elements.
beforeEach(() => { | ||
cy.resetLogin(); | ||
cy.login("TEST_USER_1"); | ||
cy.visit("/"); |
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.
Maybe we should wait for the page loading after visiting.
@@ -72,6 +72,7 @@ const UserInfoAvatarButton: Component = () => {//头像组件 | |||
return ( | |||
<> | |||
<IconButton | |||
id="user-info-avatar-button" |
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.
I can accept using id for testing, but it's better to use aria-
tags to identify the elements.
I found a related issue from testing-library/react-testing-library: testing-library/react-testing-library#16.
@@ -101,7 +102,7 @@ const UserInfoAvatarButton: Component = () => {//头像组件 | |||
</CardContent > | |||
<Divider /> | |||
<CardActions sx={{ justifyContent: "end" }}> | |||
<Button sx={{padding: "8px"}} color="error" variant="text" size="small" onClick={userSignOut}> | |||
<Button id="sign-out-button" sx={{padding: "8px"}} color="error" variant="text" size="small" onClick={userSignOut}> |
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.
Same as L75 in the incoming change: it's better to use aria-
tags.
This PR is intended to add more tests for the index page.