Add more MockPollHistoryScreenState cases

This commit is contained in:
Alfonso Grillo
2023-01-25 19:41:48 +01:00
parent bbf7bad5c3
commit 544c505197
2 changed files with 36 additions and 14 deletions
@@ -17,13 +17,15 @@
import Combine
final class MockPollHistoryService: PollHistoryServiceProtocol {
lazy var nextBatchPublisher: AnyPublisher<TimelinePollDetails, Error> = (activePollsData + pastPollsData)
.publisher
.setFailureType(to: Error.self)
.eraseToAnyPublisher()
lazy var nextBatchPublishers: [AnyPublisher<TimelinePollDetails, Error>] = [
(activePollsData + pastPollsData)
.publisher
.setFailureType(to: Error.self)
.eraseToAnyPublisher()
]
func nextBatch() -> AnyPublisher<TimelinePollDetails, Error> {
nextBatchPublisher
nextBatchPublishers.isEmpty ? Empty().eraseToAnyPublisher() : nextBatchPublishers.removeFirst()
}
var updatesPublisher: AnyPublisher<TimelinePollDetails, Never> = Empty().eraseToAnyPublisher()