1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-30 02:21:17 +03:00

Update dependency @vector-im/compound-web to v0.9.4 (#11891)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
renovate[bot]
2023-12-14 11:10:01 +00:00
committed by GitHub
parent 4f19356492
commit 6669cb70e4
11 changed files with 288 additions and 86 deletions

View File

@ -34,6 +34,10 @@ import { PollHistoryDialog } from "../../../../src/components/views/dialogs/Poll
import { RoomPermalinkCreator } from "../../../../src/utils/permalinks/Permalinks";
import { _t } from "../../../../src/languageHandler";
import SettingsStore from "../../../../src/settings/SettingsStore";
import { tagRoom } from "../../../../src/utils/room/tagRoom";
import { DefaultTagID } from "../../../../src/stores/room-list/models";
jest.mock("../../../../src/utils/room/tagRoom");
describe("<RoomSummaryCard />", () => {
const userId = "@alice:domain.org";
@ -63,6 +67,9 @@ describe("<RoomSummaryCard />", () => {
isRoomEncrypted: jest.fn(),
getOrCreateFilter: jest.fn().mockResolvedValue({ filterId: 1 }),
getRoom: jest.fn(),
isGuest: jest.fn().mockReturnValue(false),
deleteRoomTag: jest.fn().mockResolvedValue({}),
setRoomTag: jest.fn().mockResolvedValue({}),
});
room = new Room(roomId, mockClient, userId);
const roomCreateEvent = new MatrixEvent({
@ -76,6 +83,7 @@ describe("<RoomSummaryCard />", () => {
state_key: "",
});
room.currentState.setStateEvents([roomCreateEvent]);
room.updateMyMembership("join");
jest.spyOn(Modal, "createDialog");
jest.spyOn(RightPanelStore.instance, "pushCard");
@ -133,6 +141,22 @@ describe("<RoomSummaryCard />", () => {
expect(Modal.createDialog).toHaveBeenCalledWith(ShareDialog, { target: room });
});
it("opens invite dialog on button click", () => {
const { getByText } = getComponent();
fireEvent.click(getByText(_t("action|invite")));
expect(defaultDispatcher.dispatch).toHaveBeenCalledWith({ action: "view_invite", roomId: room.roomId });
});
it("fires favourite dispatch on button click", () => {
const { getByText } = getComponent();
fireEvent.click(getByText(_t("room|context_menu|favourite")));
expect(tagRoom).toHaveBeenCalledWith(room, DefaultTagID.Favourite);
});
it("opens room settings on button click", () => {
const { getByText } = getComponent();

View File

@ -71,24 +71,24 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</section>
</header>
<div
class="_separator_1uqhh_17"
class="_separator_1dey0_17"
data-orientation="horizontal"
role="separator"
/>
<label
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
for=":r1:"
role="menuitemcheckbox"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Favourite
</span>
@ -106,25 +106,24 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</div>
</label>
<button
class="_item_zxa40_17 _interactive_zxa40_36 _disabled_zxa40_125"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
disabled=""
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Invite
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"
@ -138,24 +137,24 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</svg>
</button>
<button
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Copy link
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"
@ -169,24 +168,24 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</svg>
</button>
<button
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Settings
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"
@ -200,29 +199,29 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</svg>
</button>
<div
class="_separator_1uqhh_17"
class="_separator_1dey0_17"
data-orientation="horizontal"
role="separator"
/>
<button
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
People
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"
@ -236,24 +235,24 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</svg>
</button>
<button
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Files
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"
@ -267,24 +266,24 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</svg>
</button>
<button
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Poll history
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"
@ -298,24 +297,24 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</svg>
</button>
<button
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="primary"
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Export Chat
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"
@ -329,29 +328,29 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
</svg>
</button>
<div
class="_separator_1uqhh_17"
class="_separator_1dey0_17"
data-orientation="horizontal"
role="separator"
/>
<button
class="_item_zxa40_17 _interactive_zxa40_36"
class="_item_1bcsk_17 _interactive_1bcsk_36"
data-kind="critical"
role="menuitem"
>
<div
aria-hidden="true"
class="_icon_zxa40_49"
class="_icon_1bcsk_44"
height="24"
width="24"
/>
<span
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_zxa40_58"
class="_typography_yh5dq_162 _font-body-md-medium_yh5dq_69 _label_1bcsk_53"
>
Leave room
</span>
<svg
aria-hidden="true"
class="_nav-hint_zxa40_65"
class="_nav-hint_1bcsk_60"
fill="none"
height="24"
viewBox="0 0 24 24"

View File

@ -406,7 +406,7 @@ describe("MemberList", () => {
await flushPromises();
// button rendered but disabled
expect(screen.getByText("Invite to this room")).toBeDisabled();
expect(screen.getByText("Invite to this room")).toHaveAttribute("aria-disabled", "true");
});
it("renders enabled invite button when current user is a member and has rights to invite", async () => {

View File

@ -238,7 +238,7 @@ describe("RoomHeader", () => {
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
for (const button of getAllByLabelText(container, "There's no one here to call")) {
expect(button).toBeDisabled();
expect(button).toHaveAttribute("aria-disabled", "true");
}
});
@ -250,8 +250,8 @@ describe("RoomHeader", () => {
);
const voiceButton = getByLabelText(container, "Voice call");
const videoButton = getByLabelText(container, "Video call");
expect(voiceButton).not.toBeDisabled();
expect(videoButton).not.toBeDisabled();
expect(voiceButton).not.toHaveAttribute("aria-disabled", "true");
expect(videoButton).not.toHaveAttribute("aria-disabled", "true");
const placeCallSpy = jest.spyOn(LegacyCallHandler.instance, "placeCall");
@ -273,7 +273,7 @@ describe("RoomHeader", () => {
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
for (const button of getAllByLabelText(container, "Ongoing call")) {
expect(button).toBeDisabled();
expect(button).toHaveAttribute("aria-disabled", "true");
}
});
@ -285,8 +285,8 @@ describe("RoomHeader", () => {
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
expect(getByLabelText(container, "Voice call")).not.toBeDisabled();
expect(getByLabelText(container, "Video call")).not.toBeDisabled();
expect(getByLabelText(container, "Voice call")).not.toHaveAttribute("aria-disabled", "true");
expect(getByLabelText(container, "Video call")).not.toHaveAttribute("aria-disabled", "true");
});
it("disable calls in large rooms by default", () => {
@ -298,10 +298,10 @@ describe("RoomHeader", () => {
);
expect(
getByLabelText(container, "You do not have permission to start voice calls", { selector: "button" }),
).toBeDisabled();
).toHaveAttribute("aria-disabled", "true");
expect(
getByLabelText(container, "You do not have permission to start video calls", { selector: "button" }),
).toBeDisabled();
).toHaveAttribute("aria-disabled", "true");
});
});
@ -324,7 +324,7 @@ describe("RoomHeader", () => {
expect(screen.queryByTitle("Voice call")).toBeNull();
const videoCallButton = getByLabelText(container, "Video call");
expect(videoCallButton).not.toBeDisabled();
expect(videoCallButton).not.toHaveAttribute("aria-disabled", "true");
const dispatcherSpy = jest.spyOn(dispatcher, "dispatch");
@ -345,7 +345,7 @@ describe("RoomHeader", () => {
<RoomHeader room={room} />,
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
expect(getByLabelText(container, "Ongoing call")).toBeDisabled();
expect(getByLabelText(container, "Ongoing call")).toHaveAttribute("aria-disabled", "true");
});
it("clicking on ongoing (unpinned) call re-pins it", () => {
@ -362,7 +362,7 @@ describe("RoomHeader", () => {
<RoomHeader room={room} />,
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
expect(getByLabelText(container, "Video call")).not.toBeDisabled();
expect(getByLabelText(container, "Video call")).not.toHaveAttribute("aria-disabled", "true");
fireEvent.click(getByLabelText(container, "Video call"));
expect(spy).toHaveBeenCalledWith(room, widget, Container.Top);
});
@ -378,7 +378,7 @@ describe("RoomHeader", () => {
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
for (const button of getAllByLabelText(container, "Ongoing call")) {
expect(button).toBeDisabled();
expect(button).toHaveAttribute("aria-disabled", "true");
}
});
@ -389,7 +389,7 @@ describe("RoomHeader", () => {
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
for (const button of getAllByLabelText(container, "There's no one here to call")) {
expect(button).toBeDisabled();
expect(button).toHaveAttribute("aria-disabled", "true");
}
});
@ -402,8 +402,8 @@ describe("RoomHeader", () => {
const voiceButton = getByLabelText(container, "Voice call");
const videoButton = getByLabelText(container, "Video call");
expect(voiceButton).not.toBeDisabled();
expect(videoButton).not.toBeDisabled();
expect(voiceButton).not.toHaveAttribute("aria-disabled", "true");
expect(videoButton).not.toHaveAttribute("aria-disabled", "true");
const placeCallSpy = jest.spyOn(LegacyCallHandler.instance, "placeCall");
fireEvent.click(voiceButton);
@ -428,8 +428,8 @@ describe("RoomHeader", () => {
const voiceButton = getByLabelText(container, "Voice call");
const videoButton = getByLabelText(container, "Video call");
expect(voiceButton).not.toBeDisabled();
expect(videoButton).not.toBeDisabled();
expect(voiceButton).not.toHaveAttribute("aria-disabled", "true");
expect(videoButton).not.toHaveAttribute("aria-disabled", "true");
const placeCallSpy = jest.spyOn(LegacyCallHandler.instance, "placeCall");
fireEvent.click(voiceButton);
@ -455,8 +455,8 @@ describe("RoomHeader", () => {
const voiceButton = getByLabelText(container, "Voice call");
const videoButton = getByLabelText(container, "Video call");
expect(voiceButton).not.toBeDisabled();
expect(videoButton).not.toBeDisabled();
expect(voiceButton).not.toHaveAttribute("aria-disabled", "true");
expect(videoButton).not.toHaveAttribute("aria-disabled", "true");
const dispatcherSpy = jest.spyOn(dispatcher, "dispatch");
fireEvent.click(videoButton);

View File

@ -3,9 +3,11 @@
exports[`<VideoRoomChatButton /> renders button when room is a video room 1`] = `
<button
aria-label="Chat"
class="_icon-button_1qjaf_17"
class="_icon-button_ur2sw_17"
data-state="closed"
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div />
</button>
@ -14,10 +16,12 @@ exports[`<VideoRoomChatButton /> renders button when room is a video room 1`] =
exports[`<VideoRoomChatButton /> renders button with an unread marker when room is unread 1`] = `
<button
aria-label="Chat"
class="_icon-button_1qjaf_17"
class="_icon-button_ur2sw_17"
data-indicator="default"
data-state="closed"
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div />
</button>

View File

@ -44,28 +44,34 @@ exports[`RoomHeader does not show the face pile for DMs 1`] = `
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-2x);"
>
<button
aria-disabled="true"
aria-label="There's no one here to call"
class="_icon-button_1qjaf_17"
class="_icon-button_ur2sw_17"
data-state="closed"
disabled=""
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div />
</button>
<button
aria-disabled="true"
aria-label="There's no one here to call"
class="_icon-button_1qjaf_17"
class="_icon-button_ur2sw_17"
data-state="closed"
disabled=""
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div />
</button>
<button
aria-label="Threads"
class="_icon-button_1qjaf_17"
class="_icon-button_ur2sw_17"
data-state="closed"
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div />
</button>