mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Fix for flaky tests (#5869)
* possible logging tests fix * fix for flaky tests * use timelimit for max test time * pr suggestions * remove comment
This commit is contained in:
@@ -181,11 +181,15 @@ struct TimelineMediaPreviewViewModelTests {
|
||||
|
||||
// When confirming the redaction.
|
||||
let deferred = deferFulfillment(viewModel.actions) { $0 == .dismiss }
|
||||
context.send(viewAction: .redactConfirmation(item: mediaItem))
|
||||
|
||||
// The redaction runs in an unstructured task, so wait for the call rather than asserting after the dismiss.
|
||||
await waitForConfirmation { confirmation in
|
||||
timelineController.redactClosure = { _ in confirmation() }
|
||||
context.send(viewAction: .redactConfirmation(item: mediaItem))
|
||||
}
|
||||
|
||||
// Then the item should be redacted and the view should be dismissed.
|
||||
try await deferred.fulfill()
|
||||
#expect(timelineController.redactCalled)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user