mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 11:15:53 +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", () => {
|
it("should open new 1:1 chat room after leaving the old one", () => {
|
||||||
// leave 1:1 chat room
|
// leave 1:1 chat room
|
||||||
cy.contains(".mx_RoomHeader_nametext", username).click();
|
cy.get(".mx_RoomHeader_nametext").within(() => {
|
||||||
cy.contains('[role="menuitem"]', "Leave").click();
|
cy.findByText(username).click();
|
||||||
cy.get('[data-testid="dialog-primary-button"]').click();
|
});
|
||||||
|
cy.findByRole("menuitem", { name: "Leave" }).click();
|
||||||
|
cy.findByRole("button", { name: "Leave" }).click();
|
||||||
|
|
||||||
// wait till the room was left
|
// wait till the room was left
|
||||||
cy.get('[role="group"][aria-label="Historical"]').within(() => {
|
cy.findByRole("group", { name: "Historical" }).within(() => {
|
||||||
cy.contains(".mx_RoomTile", username);
|
cy.get(".mx_RoomTile").within(() => {
|
||||||
|
cy.findByText(username);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// open new 1:1 chat room
|
// open new 1:1 chat room
|
||||||
cy.visit(`/#/user/${user2.userId}?action=chat`);
|
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