Update RoomSummaryCard navigation links (#11812)

* Update RoomSummaryCard navigation links

* Fix tests

* remove unneeded test

* "@vector-im/compound-web": "0.8.0"

* Fix: search button no transition on hover

* Fix: disabled invite option is not reflected in UI

* test canInviteTo

* update snapshots for CW 0.8.1

* unit test inviteToRoom

* unit test tagRoom

* add member link to roomsummarycard when using legacy room header

* use onChange instead of onClick for ToggleMenuItem favourite room

* update selectors in cypress tests

* always show people menu item

* add hover style to close button

* add padding around room name

* prettier

---------

Co-authored-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Germain 2023-11-16 03:25:34 +00:00 committed by GitHub
parent b8ff3c169b
commit f96583e74a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 857 additions and 245 deletions

View file

@ -116,7 +116,7 @@ const verify = function (this: CryptoTestContext) {
const bobsVerificationRequestPromise = waitForVerificationRequest(this.bob);
openRoomInfo().within(() => {
cy.findByRole("button", { name: /People \d/ }).click(); // \d is the number of the room members
cy.findByRole("menuitem", { name: "People" }).click();
cy.findByText("Bob").click();
cy.findByRole("button", { name: "Verify" }).click();
cy.findByRole("button", { name: "Start Verification" }).click();

View file

@ -47,16 +47,8 @@ describe("Invite dialog", function () {
// Open the room info panel
cy.findByRole("button", { name: "Room info" }).click();
cy.get(".mx_RightPanel").within(() => {
// Click "People" button on the panel
// Regex pattern due to the string of "mx_BaseCard_Button_sublabel"
cy.findByRole("button", { name: /People/ }).click();
});
cy.get(".mx_BaseCard").within(() => {
// Click "Invite to this room" button
// Regex pattern due to "mx_MemberList_invite span::before"
cy.findByRole("button", { name: /Invite to this room/ }).click();
cy.findByRole("menuitem", { name: "Invite" }).click();
});
cy.get(".mx_InviteDialog_other").within(() => {

View file

@ -121,7 +121,7 @@ describe("Lazy Loading", () => {
});
cy.get(".mx_RoomSummaryCard").within(() => {
cy.findByRole("button", { name: /People \d/ }).click(); // \d represents the number of the room members
cy.findByRole("menuitem", { name: "People" }).click(); // \d represents the number of the room members
});
}

View file

@ -77,7 +77,7 @@ describe("Poll history", () => {
function openPollHistory(): void {
cy.findByRole("button", { name: "Room info" }).click();
cy.get(".mx_RoomSummaryCard").within(() => {
cy.findByRole("button", { name: "Poll history" }).click();
cy.findByRole("menuitem", { name: "Poll history" }).click();
});
}

View file

@ -61,7 +61,7 @@ describe("FilePanel", () => {
// Open the file panel
viewRoomSummaryByName(ROOM_NAME);
cy.get(".mx_RoomSummaryCard_icon_files").click();
cy.findByRole("menuitem", { name: "Files" }).click();
cy.get(".mx_FilePanel").should("have.length", 1);
});

View file

@ -103,21 +103,21 @@ describe("RightPanel", () => {
it("should handle viewing export chat", () => {
viewRoomSummaryByName(ROOM_NAME);
cy.findByRole("button", { name: "Export chat" }).click();
cy.findByRole("menuitem", { name: "Export Chat" }).click();
cy.get(".mx_ExportDialog").should("have.length", 1);
});
it("should handle viewing share room", () => {
viewRoomSummaryByName(ROOM_NAME);
cy.findByRole("button", { name: "Share room" }).click();
cy.findByRole("menuitem", { name: "Copy link" }).click();
cy.get(".mx_ShareDialog").should("have.length", 1);
});
it("should handle viewing room settings", () => {
viewRoomSummaryByName(ROOM_NAME);
cy.findByRole("button", { name: "Room settings" }).click();
cy.findByRole("menuitem", { name: "Settings" }).click();
cy.get(".mx_RoomSettingsDialog").should("have.length", 1);
cy.get(".mx_Dialog_title").within(() => {
cy.findByText("Room Settings - " + ROOM_NAME).should("exist");
@ -127,7 +127,7 @@ describe("RightPanel", () => {
it("should handle viewing files", () => {
viewRoomSummaryByName(ROOM_NAME);
cy.findByRole("button", { name: "Files" }).click();
cy.findByRole("menuitem", { name: "Files" }).click();
cy.get(".mx_FilePanel").should("have.length", 1);
cy.get(".mx_FilePanel_empty").should("have.length", 1);
@ -138,8 +138,7 @@ describe("RightPanel", () => {
it("should handle viewing room member", () => {
viewRoomSummaryByName(ROOM_NAME);
// \d represents the number of the room members inside mx_BaseCard_Button_sublabel
cy.findByRole("button", { name: /People \d/ }).click();
cy.findByRole("menuitem", { name: "People" }).click();
cy.get(".mx_MemberList").should("have.length", 1);
getMemberTileByName(NAME).click();