Fix alert presentation

This commit is contained in:
Alfonso Grillo
2023-01-26 14:52:33 +01:00
parent 2f030b0811
commit a83075f2f3
5 changed files with 10 additions and 28 deletions
@@ -1,4 +1,4 @@
//
//
// Copyright 2023 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -104,18 +104,11 @@ final class PollHistoryViewModelTests: XCTestCase {
}
func testAfterFailureCompletionIsCalled() throws {
let expectation = expectation(description: #function)
pollHistoryService.nextBatchPublishers = [MockPollPublisher.failure]
viewModel.completion = { event in
XCTAssertEqual(event, .genericError)
expectation.fulfill()
}
viewModel.process(viewAction: .viewAppeared)
XCTAssertFalse(viewModel.state.isLoading)
XCTAssertNotNil(viewModel.state.polls)
wait(for: [expectation], timeout: 1.0)
XCTAssertNotNil(viewModel.state.bindings.alertInfo)
}
}