diff --git a/res/css/structures/_LeftPanel.pcss b/res/css/structures/_LeftPanel.pcss index 0846c59a81..95ca5c350d 100644 --- a/res/css/structures/_LeftPanel.pcss +++ b/res/css/structures/_LeftPanel.pcss @@ -185,6 +185,10 @@ $roomListCollapsedWidth: 68px; } } + .mx_RoomListHeader:first-child { + margin-top: 12px; + } + .mx_LeftPanel_roomListWrapper { /* Make the y-scrollbar more responsive */ padding-right: 2px; diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index bb83005d7c..eab1972798 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -393,7 +393,7 @@ export default class LeftPanel extends React.Component { return (
- {this.renderSearchDialExplore()} + {shouldShowComponent(UIComponent.FilterContainer) && this.renderSearchDialExplore()} {this.renderBreadcrumbs()} {!this.props.isMinimized && } ({ + shouldShowComponent: jest.fn(), +})); + +describe("LeftPanel", () => { + function renderComponent(): RenderResult { + return render( + , + ); + } + + it("does not show filter container when disabled by UIComponent customisations", () => { + mocked(shouldShowComponent).mockReturnValue(false); + renderComponent(); + expect(shouldShowComponent).toHaveBeenCalledWith(UIComponent.FilterContainer); + expect(screen.queryByRole("button", { name: /search/i })).not.toBeInTheDocument(); + expect(screen.queryByRole("button", { name: "Explore rooms" })).not.toBeInTheDocument(); + }); + + it("renders filter container when enabled by UIComponent customisations", () => { + mocked(shouldShowComponent).mockReturnValue(true); + renderComponent(); + expect(shouldShowComponent).toHaveBeenCalledWith(UIComponent.FilterContainer); + expect(screen.getByRole("button", { name: /search/i })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Explore rooms" })).toBeInTheDocument(); + }); +});