mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Don't hold the room list on skeletons for an empty filtered result
The room list keeps showing skeletons while the provider reports loaded but no summaries have published yet, to avoid flashing an empty list before the first batch lands. That guard also fired when a filter (chips, space or search) legitimately matched nothing, leaving the home screen on placeholders forever instead of showing the empty filter state.
This commit is contained in:
@@ -408,6 +408,19 @@ final class HomeScreenViewModelTests {
|
||||
try await deferred.fulfill()
|
||||
}
|
||||
|
||||
@Test
|
||||
func roomListModeDoesntHoldSkeletonsForAnEmptyFilteredResult() async throws {
|
||||
let (roomListSubject, stateSubject) = setupViewModelWithManualProvider()
|
||||
#expect(context.viewState.roomListMode == .skeletons)
|
||||
|
||||
// A filter is active before anything has published and the filtered list is loaded but empty.
|
||||
context.filtersState.activateFilter(.people)
|
||||
let deferred = deferFulfillment(context.$viewState) { $0.roomListMode == .rooms }
|
||||
roomListSubject.send([])
|
||||
stateSubject.send(.loaded(totalNumberOfRooms: 8))
|
||||
try await deferred.fulfill()
|
||||
}
|
||||
|
||||
@Test
|
||||
func roomListModeDoesntReturnToSkeletonsWhenTheRoomsAreFilteredOut() async throws {
|
||||
let (roomListSubject, stateSubject) = setupViewModelWithManualProvider()
|
||||
|
||||
Reference in New Issue
Block a user