Skip to content

Commit be5dd05

Browse files
authored
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.
1 parent 2326a7c commit be5dd05

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -238,27 +238,6 @@ describe("RoomListViewModel", () => {
238238
];
239239

240240
describe.each(testcases)("For secondary filter: %s", (secondaryFilterName, secondary, primaryFilterName) => {
241-
it(`should unapply incompatible primary filter that is already active: ${primaryFilterName}`, () => {
242-
const { fn } = mockAndCreateRooms();
243-
const { result: vm } = renderHook(() => useRoomListViewModel());
244-
245-
// Apply the primary filter
246-
const i = vm.current.primaryFilters.findIndex((f) => f.name === primaryFilterName);
247-
act(() => {
248-
vm.current.primaryFilters[i].toggle();
249-
});
250-
251-
// Apply the secondary filter
252-
act(() => {
253-
vm.current.activateSecondaryFilter(secondary.secondary);
254-
});
255-
256-
// RLS call should only include the secondary filter
257-
expect(fn).toHaveBeenLastCalledWith([secondary.filterKey]);
258-
// Primary filter should have been unapplied
259-
expect(vm.current.primaryFilters[i].active).toEqual(false);
260-
});
261-
262241
it(`should hide incompatible primary filter: ${primaryFilterName}`, () => {
263242
mockAndCreateRooms();
264243
const { result: vm } = renderHook(() => useRoomListViewModel());

0 commit comments

Comments
 (0)