mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
A bunch of random tweaks. (#3317)
- Fix warning on single case enum. - Remove unused subjects. - Fix a lint warning. - Remove unused success value. - Fix warning about position of try await. - Add a note about the common tracing configuration. - Show an indicator when resolving a send failure fails. - Make sure the whole row is clickable in the GlobalSearchScreen.
This commit is contained in:
@@ -60,7 +60,10 @@ class ResolveVerifiedUserSendFailureScreenViewModelTests: XCTestCase {
|
||||
// MARK: Helpers
|
||||
|
||||
private func makeViewModel(with failure: TimelineItemSendFailure.VerifiedUser) -> ResolveVerifiedUserSendFailureScreenViewModel {
|
||||
ResolveVerifiedUserSendFailureScreenViewModel(failure: failure, itemID: .random, roomProxy: roomProxy)
|
||||
ResolveVerifiedUserSendFailureScreenViewModel(failure: failure,
|
||||
itemID: .random,
|
||||
roomProxy: roomProxy,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
|
||||
private func verifyResolving(userIDs: [String], assertStrings: Bool = true) async throws {
|
||||
@@ -73,7 +76,7 @@ class ResolveVerifiedUserSendFailureScreenViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
// When resolving the first failure.
|
||||
let deferredFailure = deferFailure(viewModel.actionsPublisher, timeout: 1) { $0.isDismiss }
|
||||
let deferredFailure = deferFailure(viewModel.actionsPublisher, timeout: 1) { $0 == .dismiss }
|
||||
context.send(viewAction: .resolveAndResend)
|
||||
|
||||
// Then the sheet should remain open for the next failure.
|
||||
@@ -88,7 +91,7 @@ class ResolveVerifiedUserSendFailureScreenViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
// When resolving the final failure.
|
||||
let deferred = deferFulfillment(viewModel.actionsPublisher) { $0.isDismiss }
|
||||
let deferred = deferFulfillment(viewModel.actionsPublisher) { $0 == .dismiss }
|
||||
context.send(viewAction: .resolveAndResend)
|
||||
|
||||
// Then the sheet should be dismissed.
|
||||
@@ -110,12 +113,3 @@ class ResolveVerifiedUserSendFailureScreenViewModelTests: XCTestCase {
|
||||
XCTAssertTrue(context.viewState.subtitle.contains(displayName))
|
||||
}
|
||||
}
|
||||
|
||||
private extension ResolveVerifiedUserSendFailureScreenViewModelAction {
|
||||
var isDismiss: Bool {
|
||||
switch self {
|
||||
case .dismiss: true
|
||||
default: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,8 +102,6 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
|
||||
func testPinnedEventsBannerSelection() async throws {
|
||||
ServiceLocator.shared.settings.pinningEnabled = true
|
||||
let timelineSubject = PassthroughSubject<TimelineProxyProtocol, Never>()
|
||||
let updateSubject = PassthroughSubject<JoinedRoomProxyAction, Never>()
|
||||
let roomProxyMock = JoinedRoomProxyMock(.init())
|
||||
// setup a way to inject the mock of the pinned events timeline
|
||||
let pinnedTimelineMock = TimelineProxyMock()
|
||||
|
||||
Reference in New Issue
Block a user