mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +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.dmRecipientInfo?.member == RoomMemberDetails(withProxy: recipient))
|
||||||
|
|
||||||
#expect(!context.viewState.isProcessingIgnoreRequest)
|
#expect(!context.viewState.isProcessingIgnoreRequest)
|
||||||
let deferredProcessing = deferFulfillment(viewModel.context.observe(\.viewState.isProcessingIgnoreRequest),
|
// Waiting on the transient isProcessingIgnoreRequest transition races the view model's task,
|
||||||
transitionValues: [true, false])
|
// which can complete before the observation starts. Wait on the alert instead.
|
||||||
|
let deferredAlert = deferFulfillment(context.observe(\.alertInfo)) { $0 != nil }
|
||||||
|
|
||||||
context.send(viewAction: .unignoreConfirmed)
|
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.viewState.dmRecipientInfo?.member.isIgnored == true)
|
||||||
#expect(context.alertInfo != nil)
|
#expect(context.alertInfo != nil)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user