mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 17:25:50 +03:00
Update one-to-one-chat.spec.ts - use Cypress Testing Library (#10572)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
This commit is contained in:
parent
c9599a3ef2
commit
d179956af8
1 changed files with 12 additions and 6 deletions
|
@ -45,17 +45,23 @@ describe("1:1 chat room", () => {
|
|||
|
||||
it("should open new 1:1 chat room after leaving the old one", () => {
|
||||
// leave 1:1 chat room
|
||||
cy.contains(".mx_RoomHeader_nametext", username).click();
|
||||
cy.contains('[role="menuitem"]', "Leave").click();
|
||||
cy.get('[data-testid="dialog-primary-button"]').click();
|
||||
cy.get(".mx_RoomHeader_nametext").within(() => {
|
||||
cy.findByText(username).click();
|
||||
});
|
||||
cy.findByRole("menuitem", { name: "Leave" }).click();
|
||||
cy.findByRole("button", { name: "Leave" }).click();
|
||||
|
||||
// wait till the room was left
|
||||
cy.get('[role="group"][aria-label="Historical"]').within(() => {
|
||||
cy.contains(".mx_RoomTile", username);
|
||||
cy.findByRole("group", { name: "Historical" }).within(() => {
|
||||
cy.get(".mx_RoomTile").within(() => {
|
||||
cy.findByText(username);
|
||||
});
|
||||
});
|
||||
|
||||
// open new 1:1 chat room
|
||||
cy.visit(`/#/user/${user2.userId}?action=chat`);
|
||||
cy.contains(".mx_RoomHeader_nametext", username);
|
||||
cy.get(".mx_RoomHeader_nametext").within(() => {
|
||||
cy.findByText(username);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue