Skip to content

Commit 6562f5a

Browse files
authored
New Room List: Change the order of filters to match those on mobile (#30905)
* Change the order of filters to match those on mobile * Fix jest test * Update screenshots to include expanded and collapsed list of filters. * lint
1 parent e0df420 commit 6562f5a

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

playwright/e2e/left-panel/room-list-panel/room-list-filter-sort.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,13 @@ test.describe("Room list filters and sort", () => {
322322
return page.getByTestId("empty-room-list");
323323
}
324324

325+
test("should render the primary filters", { tag: "@screenshot" }, async ({ page, app, user }) => {
326+
const primaryFilters = getPrimaryFilters(page);
327+
await expect(primaryFilters).toMatchScreenshot("collapsed-primary-filters.png");
328+
await getFilterExpandButton(page).click();
329+
await expect(primaryFilters).toMatchScreenshot("expanded-primary-filters.png");
330+
});
331+
325332
test(
326333
"should render the default placeholder when there is no filter",
327334
{ tag: "@screenshot" },
3.38 KB
Loading
8.52 KB
Loading

src/components/viewmodels/roomlist/useFilteredRooms.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ const filterKeyToNameMap: Map<FilterKey, TranslationKey> = new Map([
4848
[FilterKey.UnreadFilter, _td("room_list|filters|unread")],
4949
[FilterKey.PeopleFilter, _td("room_list|filters|people")],
5050
[FilterKey.RoomsFilter, _td("room_list|filters|rooms")],
51+
[FilterKey.FavouriteFilter, _td("room_list|filters|favourite")],
5152
[FilterKey.MentionsFilter, _td("room_list|filters|mentions")],
5253
[FilterKey.InvitesFilter, _td("room_list|filters|invites")],
53-
[FilterKey.FavouriteFilter, _td("room_list|filters|favourite")],
5454
[FilterKey.LowPriorityFilter, _td("room_list|filters|low_priority")],
5555
]);
5656

test/unit-tests/components/viewmodels/roomlist/RoomListViewModel-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ describe("RoomListViewModel", () => {
7272
"Unreads",
7373
"People",
7474
"Rooms",
75+
"Favourites",
7576
"Mentions",
7677
"Invites",
77-
"Favourites",
7878
"Low priority",
7979
].entries()) {
8080
expect(vm.current.primaryFilters[i].name).toEqual(name);

0 commit comments

Comments
 (0)