From be5dd058b33e512a1e40b789f26abff5ee19afd8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 14 May 2025 14:12:34 +0100 Subject: [PATCH] Remove old filter test (#29963) This wasn't testing what it thought it was testing because the primary filters aren't present at all after selecting a secondary filter that's not compatible with them, so it was just asserting that some other filter (which had the same index as the old one) was disabled. It breaks if the primary filters get reordered. --- .../roomlist/RoomListViewModel-test.tsx | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/test/unit-tests/components/viewmodels/roomlist/RoomListViewModel-test.tsx b/test/unit-tests/components/viewmodels/roomlist/RoomListViewModel-test.tsx index 3a95f6dab9..b4b7193c17 100644 --- a/test/unit-tests/components/viewmodels/roomlist/RoomListViewModel-test.tsx +++ b/test/unit-tests/components/viewmodels/roomlist/RoomListViewModel-test.tsx @@ -238,27 +238,6 @@ describe("RoomListViewModel", () => { ]; describe.each(testcases)("For secondary filter: %s", (secondaryFilterName, secondary, primaryFilterName) => { - it(`should unapply incompatible primary filter that is already active: ${primaryFilterName}`, () => { - const { fn } = mockAndCreateRooms(); - const { result: vm } = renderHook(() => useRoomListViewModel()); - - // Apply the primary filter - const i = vm.current.primaryFilters.findIndex((f) => f.name === primaryFilterName); - act(() => { - vm.current.primaryFilters[i].toggle(); - }); - - // Apply the secondary filter - act(() => { - vm.current.activateSecondaryFilter(secondary.secondary); - }); - - // RLS call should only include the secondary filter - expect(fn).toHaveBeenLastCalledWith([secondary.filterKey]); - // Primary filter should have been unapplied - expect(vm.current.primaryFilters[i].active).toEqual(false); - }); - it(`should hide incompatible primary filter: ${primaryFilterName}`, () => { mockAndCreateRooms(); const { result: vm } = renderHook(() => useRoomListViewModel());