QR Code Login Initial view state (#2667)

This commit is contained in:
Mauro
2024-04-09 12:21:14 +02:00
committed by GitHub
parent bc75fe1cf8
commit c61135f88c
27 changed files with 623 additions and 93 deletions
@@ -2338,6 +2338,26 @@ class PollInteractionHandlerMock: PollInteractionHandlerProtocol {
}
}
}
class QRCodeLoginServiceMock: QRCodeLoginServiceProtocol {
//MARK: - requestAuthorizationIfNeeded
var requestAuthorizationIfNeededCallsCount = 0
var requestAuthorizationIfNeededCalled: Bool {
return requestAuthorizationIfNeededCallsCount > 0
}
var requestAuthorizationIfNeededReturnValue: Bool!
var requestAuthorizationIfNeededClosure: (() async -> Bool)?
func requestAuthorizationIfNeeded() async -> Bool {
requestAuthorizationIfNeededCallsCount += 1
if let requestAuthorizationIfNeededClosure = requestAuthorizationIfNeededClosure {
return await requestAuthorizationIfNeededClosure()
} else {
return requestAuthorizationIfNeededReturnValue
}
}
}
class RoomDirectorySearchProxyMock: RoomDirectorySearchProxyProtocol {
var resultsPublisher: CurrentValuePublisher<[RoomDirectorySearchResult], Never> {
get { return underlyingResultsPublisher }