From d94808a197b5284447cccd4c93d20a34eeb11223 Mon Sep 17 00:00:00 2001 From: Germain Date: Wed, 2 Aug 2023 16:29:19 +0100 Subject: [PATCH] Make room model mandatory on the RoomHeader (#11355) * Remove oobData from RoomHeader It is never used as the RoomHeader is not shown unless a Room model exists * Make room model mandatory on the RoomHeader --- src/components/structures/RoomView.tsx | 9 ++-- .../WaitingForThirdPartyRoomView.tsx | 2 +- src/components/views/rooms/RoomHeader.tsx | 12 ++--- .../views/rooms/RoomHeader-test.tsx | 17 ------- .../__snapshots__/RoomHeader-test.tsx.snap | 44 ------------------- 5 files changed, 8 insertions(+), 76 deletions(-) delete mode 100644 test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index bdbb827a00..8abdd0c16b 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -297,7 +297,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
{SettingsStore.getValue("feature_new_room_decoration_ui") ? ( - + ) : ( {SettingsStore.getValue("feature_new_room_decoration_ui") ? ( - + ) : ( { )} {SettingsStore.getValue("feature_new_room_decoration_ui") ? ( - + ) : ( = ({ roomView, resize
{SettingsStore.getValue("feature_new_room_decoration_ui") ? ( - + ) : ( - {room ? ( - - ) : ( - - )} +
{ setCardSpy = jest.spyOn(RightPanelStore.instance, "setCard"); }); - it("renders with no props", () => { - const { asFragment } = render(); - expect(asFragment()).toMatchSnapshot(); - }); - it("renders the room header", () => { const { container } = render(); expect(container).toHaveTextContent(ROOM_ID); }); - it("display the out-of-band room name", () => { - const OOB_NAME = "My private room"; - const { container } = render( - , - ); - expect(container).toHaveTextContent(OOB_NAME); - }); - it("renders the room topic", async () => { const TOPIC = "Hello World!"; diff --git a/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap b/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap deleted file mode 100644 index db5c2033d6..0000000000 --- a/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap +++ /dev/null @@ -1,44 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Roomeader renders with no props 1`] = ` - -
- - - - -
-
- Join Room -
-
-
-
-`;