Merge branch 'develop' into germain-gg/notifications-labs

# Conflicts:
#	src/i18n/strings/en_EN.json
#	test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap
This commit is contained in:
Johannes Marbach 2023-09-04 14:08:50 +02:00
commit 44d4de14c9
143 changed files with 7371 additions and 6803 deletions

View file

@ -245,9 +245,6 @@ describe("EventTile", () => {
const eventTiles = container.getElementsByClassName("mx_EventTile");
expect(eventTiles).toHaveLength(1);
const eventTile = eventTiles[0];
expect(eventTile.classList).toContain("mx_EventTile_unverified");
// there should be a warning shield
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(1);
@ -273,9 +270,6 @@ describe("EventTile", () => {
const eventTiles = container.getElementsByClassName("mx_EventTile");
expect(eventTiles).toHaveLength(1);
const eventTile = eventTiles[0];
expect(eventTile.classList).toContain("mx_EventTile_verified");
// there should be no warning
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(0);
@ -299,9 +293,6 @@ describe("EventTile", () => {
const eventTiles = container.getElementsByClassName("mx_EventTile");
expect(eventTiles).toHaveLength(1);
const eventTile = eventTiles[0];
expect(eventTile.classList).toContain("mx_EventTile_verified");
// there should be no warning
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(0);
@ -324,7 +315,6 @@ describe("EventTile", () => {
});
// check it was updated
expect(eventTile.classList).toContain("mx_EventTile_unverified");
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(1);
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0].classList).toContain(
"mx_EventTile_e2eIcon_warning",
@ -351,9 +341,6 @@ describe("EventTile", () => {
const eventTiles = container.getElementsByClassName("mx_EventTile");
expect(eventTiles).toHaveLength(1);
const eventTile = eventTiles[0];
expect(eventTile.classList).toContain("mx_EventTile_verified");
// there should be no warning
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(0);
@ -372,7 +359,6 @@ describe("EventTile", () => {
});
// check it was updated
expect(eventTile.classList).not.toContain("mx_EventTile_verified");
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(1);
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0].classList).toContain(
"mx_EventTile_e2eIcon_warning",

View file

@ -17,7 +17,7 @@ limitations under the License.
import React from "react";
import userEvent from "@testing-library/user-event";
import { CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call";
import { EventType, MatrixClient, MatrixEvent, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix";
import { EventType, JoinRule, MatrixClient, MatrixEvent, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix";
import { getAllByTitle, getByLabelText, getByText, getByTitle, render, screen, waitFor } from "@testing-library/react";
import { mkEvent, stubClient, withClientContextRenderOptions } from "../../../test-utils";
@ -426,6 +426,26 @@ describe("RoomHeader", () => {
});
});
describe("public room", () => {
it("shows a globe", () => {
const joinRuleEvent = new MatrixEvent({
type: EventType.RoomJoinRules,
content: { join_rule: JoinRule.Public },
sender: MatrixClientPeg.get()!.getSafeUserId(),
state_key: "",
room_id: room.roomId,
});
room.addLiveEvents([joinRuleEvent]);
const { container } = render(
<RoomHeader room={room} />,
withClientContextRenderOptions(MatrixClientPeg.get()!),
);
expect(getByLabelText(container, "Public room")).toBeInTheDocument();
});
});
describe("dm", () => {
let client: MatrixClient;
beforeEach(() => {

View file

@ -12,7 +12,7 @@ exports[`<PinnedEventTile /> should render pinned event 1`] = `
data-type="round"
role="presentation"
style="--cpd-avatar-size: 24px;"
title=""
title="@alice:server.org"
>
a
</span>

View file

@ -6,28 +6,24 @@ exports[`RoomHeader does not show the face pile for DMs 1`] = `
class="mx_Flex mx_RoomHeader light-panel"
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
>
<div
class="mx_DecoratedRoomAvatar"
<span
class="_avatar_2lhia_17 mx_BaseAvatar _avatar-imageless_2lhia_56"
data-color="7"
data-testid="avatar-img"
data-type="round"
role="presentation"
style="--cpd-avatar-size: 40px;"
title="!1:example.org"
>
<span
class="_avatar_2lhia_17 mx_BaseAvatar _avatar-imageless_2lhia_56"
data-color="7"
data-testid="avatar-img"
data-type="round"
role="presentation"
style="--cpd-avatar-size: 40px;"
title=""
>
!
</span>
</div>
!
</span>
<div
class="mx_Box mx_RoomHeader_info mx_Box--flex"
style="--mx-box-flex: 1;"
>
<div
aria-level="1"
class="_font-body-lg-semibold_1g2sj_89"
class="_font-body-lg-semibold_1g2sj_89 mx_RoomHeader_heading"
dir="auto"
role="heading"
title="!1:example.org"
@ -40,7 +36,7 @@ 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
class="_icon-button_yvmcf_17"
class="_icon-button_1k9cw_17"
disabled=""
style="--cpd-icon-button-size: 32px;"
title="There's no one here to call"
@ -48,7 +44,7 @@ exports[`RoomHeader does not show the face pile for DMs 1`] = `
<div />
</button>
<button
class="_icon-button_yvmcf_17"
class="_icon-button_1k9cw_17"
disabled=""
style="--cpd-icon-button-size: 32px;"
title="There's no one here to call"
@ -56,7 +52,7 @@ exports[`RoomHeader does not show the face pile for DMs 1`] = `
<div />
</button>
<button
class="_icon-button_yvmcf_17"
class="_icon-button_1k9cw_17"
style="--cpd-icon-button-size: 32px;"
title="Threads"
>

View file

@ -29,7 +29,7 @@ exports[`<RoomPreviewBar /> message case AskToJoin renders the corresponding mes
data-type="round"
role="presentation"
style="--cpd-avatar-size: 36px;"
title=""
title="RoomPreviewBar-test-room"
>
R
</span>
@ -222,7 +222,7 @@ exports[`<RoomPreviewBar /> with an invite with an invited email when client has
data-type="round"
role="presentation"
style="--cpd-avatar-size: 36px;"
title=""
title="RoomPreviewBar-test-room"
>
R
</span>
@ -281,7 +281,7 @@ exports[`<RoomPreviewBar /> with an invite without an invited email for a dm roo
data-type="round"
role="presentation"
style="--cpd-avatar-size: 36px;"
title=""
title="RoomPreviewBar-test-room"
>
R
</span>
@ -347,7 +347,7 @@ exports[`<RoomPreviewBar /> with an invite without an invited email for a non-dm
data-type="round"
role="presentation"
style="--cpd-avatar-size: 36px;"
title=""
title="RoomPreviewBar-test-room"
>
R
</span>

View file

@ -20,7 +20,7 @@ exports[`RoomTile when message previews are enabled and there is a message in a
data-type="round"
role="presentation"
style="--cpd-avatar-size: 32px;"
title=""
title="!1:example.org"
>
!
</span>
@ -95,7 +95,7 @@ exports[`RoomTile when message previews are enabled and there is a message in th
data-type="round"
role="presentation"
style="--cpd-avatar-size: 32px;"
title=""
title="!1:example.org"
>
!
</span>
@ -170,7 +170,7 @@ exports[`RoomTile when message previews are enabled should render a room without
data-type="round"
role="presentation"
style="--cpd-avatar-size: 32px;"
title=""
title="!1:example.org"
>
!
</span>
@ -233,7 +233,7 @@ exports[`RoomTile when message previews are not enabled should render the room 1
data-type="round"
role="presentation"
style="--cpd-avatar-size: 32px;"
title=""
title="!1:example.org"
>
!
</span>