mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 03:06:37 +00:00
Hopefully fix the flakey unignoreFailure RoomDetailsScreenViewModelTests
This commit is contained in:
@@ -271,13 +271,15 @@ struct RoomDetailsScreenViewModelTests {
|
||||
#expect(context.viewState.dmRecipientInfo?.member == RoomMemberDetails(withProxy: recipient))
|
||||
|
||||
#expect(!context.viewState.isProcessingIgnoreRequest)
|
||||
let deferredProcessing = deferFulfillment(viewModel.context.observe(\.viewState.isProcessingIgnoreRequest),
|
||||
transitionValues: [true, false])
|
||||
// Waiting on the transient isProcessingIgnoreRequest transition races the view model's task,
|
||||
// which can complete before the observation starts. Wait on the alert instead.
|
||||
let deferredAlert = deferFulfillment(context.observe(\.alertInfo)) { $0 != nil }
|
||||
|
||||
context.send(viewAction: .unignoreConfirmed)
|
||||
|
||||
try await deferredProcessing.fulfill()
|
||||
try await deferredAlert.fulfill()
|
||||
|
||||
#expect(!context.viewState.isProcessingIgnoreRequest)
|
||||
#expect(context.viewState.dmRecipientInfo?.member.isIgnored == true)
|
||||
#expect(context.alertInfo != nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user