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.
This commit is contained in:
David Baker 2025-05-14 14:12:34 +01:00 committed by GitHub
parent 2326a7c8dc
commit be5dd058b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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());