mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 08:15:24 +00:00
Add a Messages tab to global search
Split global search into Rooms and Messages tabs. The Messages tab lists matching events with the room's name and avatar, a sender-prefixed preview, rich media (image/video/audio/file) previews, and a loading indicator, then paginates as you scroll. Queries are debounced and the previous one is superseded so late results can't clobber a newer search.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
@testable import ElementX
|
||||
import Testing
|
||||
|
||||
@@ -16,7 +17,14 @@ struct SearchScreenViewModelTests {
|
||||
}
|
||||
|
||||
init() {
|
||||
let searchService = SearchServiceProxyMock()
|
||||
searchService.underlyingResultsPublisher = CurrentValueSubject<[SearchServiceResult], Never>([]).asCurrentValuePublisher()
|
||||
searchService.underlyingPaginationStatePublisher = CurrentValueSubject(.idle(endReached: true)).asCurrentValuePublisher()
|
||||
searchService.setQueryReturnValue = .success(())
|
||||
|
||||
viewModel = SearchScreenViewModel(roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))),
|
||||
searchService: searchService,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MediaProviderMock(.init()))
|
||||
}
|
||||
|
||||
@@ -31,7 +39,7 @@ struct SearchScreenViewModelTests {
|
||||
func roomSelection() async throws {
|
||||
let deferred = deferFulfillment(viewModel.actionsPublisher) { action in
|
||||
switch action {
|
||||
case .presentRoom(let roomID):
|
||||
case .presentRoom(let roomID, _):
|
||||
roomID == "2"
|
||||
case .cancel:
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user