mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +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:
@@ -741,11 +741,7 @@ final class ComposerToolbarViewModelTests {
|
||||
}
|
||||
}
|
||||
|
||||
// There are 2 violations, ensure that resolving the first one is not enough
|
||||
let mockSubject = CurrentValueSubject<[IdentityStatusChange], Never>([
|
||||
IdentityStatusChange(userId: "@alice:localhost", changedTo: .verificationViolation),
|
||||
IdentityStatusChange(userId: "@bob:localhost", changedTo: .verificationViolation)
|
||||
])
|
||||
let mockSubject = CurrentValueSubject<[IdentityStatusChange], Never>([])
|
||||
|
||||
roomProxyMock.identityStatusChangesPublisher = mockSubject.asCurrentValuePublisher()
|
||||
|
||||
@@ -761,12 +757,16 @@ final class ComposerToolbarViewModelTests {
|
||||
composerDraftService: draftServiceMock)
|
||||
|
||||
var fulfillment = deferFulfillment(viewModel.context.$viewState, message: "Composer is disabled") { $0.canSend == false }
|
||||
mockSubject.send([IdentityStatusChange(userId: "@alice:localhost", changedTo: .verificationViolation)])
|
||||
mockSubject.send([
|
||||
IdentityStatusChange(userId: "@alice:localhost", changedTo: .verificationViolation),
|
||||
IdentityStatusChange(userId: "@bob:localhost", changedTo: .verificationViolation)
|
||||
])
|
||||
try await fulfillment.fulfill()
|
||||
|
||||
fulfillment = deferFulfillment(viewModel.context.$viewState, message: "Composer is still disabled") { $0.canSend == false }
|
||||
// There are 2 violations, ensure that resolving the first one is not enough.
|
||||
let failure = deferFailure(viewModel.context.$viewState, timeout: .seconds(1), message: "Composer should still be disabled") { $0.canSend == true }
|
||||
mockSubject.send([IdentityStatusChange(userId: "@alice:localhost", changedTo: .pinned)])
|
||||
try await fulfillment.fulfill()
|
||||
try await failure.fulfill()
|
||||
|
||||
fulfillment = deferFulfillment(viewModel.context.$viewState, message: "Composer is now enabled") { $0.canSend == true }
|
||||
mockSubject.send([IdentityStatusChange(userId: "@bob:localhost", changedTo: .pinned)])
|
||||
|
||||
Reference in New Issue
Block a user