Add room topic to right panel room info (#12503)
* Add room topic to right panel room info Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Tweak styles Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshot Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add snapshot tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
38893928cb
commit
eee0b2a9c3
18 changed files with 1055 additions and 33 deletions
|
@ -107,6 +107,40 @@ describe("<RoomSummaryCard />", () => {
|
|||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("renders the room topic in the summary", () => {
|
||||
room.currentState.setStateEvents([
|
||||
new MatrixEvent({
|
||||
type: "m.room.topic",
|
||||
room_id: roomId,
|
||||
sender: userId,
|
||||
content: {
|
||||
topic: "This is the room's topic.",
|
||||
},
|
||||
state_key: "",
|
||||
}),
|
||||
]);
|
||||
const { container } = getComponent();
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("has button to edit topic when expanded", () => {
|
||||
room.currentState.setStateEvents([
|
||||
new MatrixEvent({
|
||||
type: "m.room.topic",
|
||||
room_id: roomId,
|
||||
sender: userId,
|
||||
content: {
|
||||
topic: "This is the room's topic.",
|
||||
},
|
||||
state_key: "",
|
||||
}),
|
||||
]);
|
||||
const { container, getByText } = getComponent();
|
||||
fireEvent.click(screen.getByText("This is the room's topic."));
|
||||
expect(getByText("Edit")).toBeInTheDocument();
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("opens the search", async () => {
|
||||
const onSearchClick = jest.fn();
|
||||
const { getByLabelText } = getComponent({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue