mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-21 18:41:10 +01:00
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:
parent
2326a7c8dc
commit
be5dd058b3
@ -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());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user