mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Allow removing individual search breadcrumbs
Each recent search now has a trailing close button to remove it from the history. The view action is logged without its payload so removed queries don't end up in the logs.
This commit is contained in:
@@ -149,6 +149,19 @@ struct SearchScreenViewModelTests {
|
||||
#expect(userSettings.searchBreadcrumbs == [.room(roomID: "2"), .query("Second")])
|
||||
}
|
||||
|
||||
@Test
|
||||
func removingBreadcrumbs() {
|
||||
userSettings.searchBreadcrumbs = [.query("Second"), .room(roomID: "2")]
|
||||
|
||||
context.send(viewAction: .removeBreadcrumb(.query("Second")))
|
||||
|
||||
#expect(userSettings.searchBreadcrumbs == [.room(roomID: "2")])
|
||||
|
||||
context.send(viewAction: .removeBreadcrumb(.room(SearchScreenRoom(.mock(id: "2", name: "Second")))))
|
||||
|
||||
#expect(userSettings.searchBreadcrumbs.isEmpty)
|
||||
}
|
||||
|
||||
@Test
|
||||
func breadcrumbsAreDisplayed() async throws {
|
||||
staticRoomListSubject.send([.mock(id: "2", name: "Second")])
|
||||
|
||||
Reference in New Issue
Block a user