You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-11-03 00:33:22 +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:
		@@ -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);
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user