-
-
Notifications
You must be signed in to change notification settings - Fork 826
Use Cypress Testing Library - right-panel.spec.ts
#10539
Conversation
checkRoomSummaryCard(ROOM_NAME); | ||
}); | ||
|
||
it("should handle viewing room member", () => { | ||
viewRoomSummaryByName(ROOM_NAME); | ||
|
||
cy.get(".mx_RoomSummaryCard_icon_people").click(); | ||
// \d represents the number of the room members inside mx_BaseCard_Button_sublabel | ||
cy.findByRole("button", { name: /People \d/ }).click(); |
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 there is not another test member on this test, this should be equal to "People 1". I thought searching with a regex pattern would be ok, as this should not be a place to check the room members count, but I am not perfectly convinced that searching "People \d" would be better than "People 1", because the latter is what the user perceives on the actual UI.
I am wondering if creating a dedicated test on this file to check whether room members number is properly counted would be in fact better.
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.
Yes, I agree it's better to just assert one thing at a time rather than effectively checking the people number is correct too. The code comment is helpful, thanks!
Signed-off-by: Suguru Hirahara <[email protected]>
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!
checkRoomSummaryCard(ROOM_NAME); | ||
}); | ||
|
||
it("should handle viewing room member", () => { | ||
viewRoomSummaryByName(ROOM_NAME); | ||
|
||
cy.get(".mx_RoomSummaryCard_icon_people").click(); | ||
// \d represents the number of the room members inside mx_BaseCard_Button_sublabel | ||
cy.findByRole("button", { name: /People \d/ }).click(); |
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.
Yes, I agree it's better to just assert one thing at a time rather than effectively checking the people number is correct too. The code comment is helpful, thanks!
Thanks for the review. |
For element-hq/element-web#25033
This PR intends to update
right-panel.spec.ts
to use Cypress Testing Library.type: task
Signed-off-by: Suguru Hirahara [email protected]
Checklist
This change is marked as an internal change (Task), so will not be included in the changelog.