mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Space filters (#4977)
* Add support for SpaceFilters on the SpaceServiceProxy level and a screen that renders them * Add aliases to a couple of space room mocks * Update translations and related snapshots * Add a feature flag for space filters * Add a new room summary provider filter that takes a list of room identifiers next to the normal state filters This will take the SpaceFilter's descendants and combine it with the normal filters to reduce the rooms shown * Add a new space filter button to the home screen and link it to the SpaceFiltersScreen and the actual RoomSummaryProvider room list filters * Bump the RustSDK to v26.01.20-2 for SpaceFilter support. * Add a cancellation button to the space filters screen * Make the filter presentation mode liquidy, move the sheet to within the home screen. * Address PR comments
This commit is contained in:
@@ -82,6 +82,25 @@ final class RoomSummaryProviderTests: XCTestCase {
|
||||
.all(filters: [.all(filters: [.category(expect: .group), .joined])] + baseFilters + [.nonLowPriority]))
|
||||
}
|
||||
|
||||
func testRoomIdentifierFilters() async {
|
||||
setupProvider()
|
||||
await Task.yield()
|
||||
|
||||
// Then it should have the default Rust filters enabled.
|
||||
XCTAssertEqual(dynamicEntriesController.setFilterKindCallsCount, 1)
|
||||
XCTAssertEqual(dynamicEntriesController.setFilterKindReceivedInvocations.last,
|
||||
.all(filters: baseFilters))
|
||||
|
||||
// When setting one our user filters.
|
||||
roomSummaryProvider.setFilter(.rooms(roomsIDs: ["SomeRoom"], filters: [.favourites]))
|
||||
await Task.yield()
|
||||
|
||||
// Then that filter should be added to the default Rust filters.
|
||||
XCTAssertEqual(dynamicEntriesController.setFilterKindCallsCount, 2)
|
||||
XCTAssertEqual(dynamicEntriesController.setFilterKindReceivedInvocations.last,
|
||||
.all(filters: [.all(filters: [.favourite, .joined])] + baseFilters + [.identifiers(identifiers: ["SomeRoom"])]))
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
private func setupProvider(isLowPriorityFilterEnabled: Bool = false) {
|
||||
|
||||
Reference in New Issue
Block a user