test(ios): bump app coverage
parent
5e09aae4ca
commit
e82ee731bf
|
|
@ -0,0 +1,31 @@
|
|||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdis
|
||||
|
||||
@Suite struct AppCoverageTests {
|
||||
@Test @MainActor func nodeAppModelUpdatesBackgroundedState() {
|
||||
let appModel = NodeAppModel()
|
||||
|
||||
appModel.setScenePhase(.background)
|
||||
#expect(appModel.isBackgrounded == true)
|
||||
|
||||
appModel.setScenePhase(.inactive)
|
||||
#expect(appModel.isBackgrounded == false)
|
||||
|
||||
appModel.setScenePhase(.active)
|
||||
#expect(appModel.isBackgrounded == false)
|
||||
}
|
||||
|
||||
@Test @MainActor func voiceWakeStartReportsUnsupportedOnSimulator() async {
|
||||
let voiceWake = VoiceWakeManager()
|
||||
voiceWake.isEnabled = true
|
||||
|
||||
await voiceWake.start()
|
||||
|
||||
#expect(voiceWake.isListening == false)
|
||||
#expect(voiceWake.statusText.contains("Simulator"))
|
||||
|
||||
voiceWake.stop()
|
||||
#expect(voiceWake.statusText == "Off")
|
||||
}
|
||||
}
|
||||
|
|
@ -67,28 +67,4 @@ import UIKit
|
|||
let root = VoiceWakeToast(command: "clawdis: do something")
|
||||
_ = Self.host(root)
|
||||
}
|
||||
|
||||
@Test @MainActor func rootCanvasBuildsAViewHierarchyAcrossBridgeStates() {
|
||||
let appModel = NodeAppModel()
|
||||
let bridgeController = BridgeConnectionController(appModel: appModel, startDiscovery: false)
|
||||
|
||||
let hostCanvas = {
|
||||
_ = Self.host(
|
||||
RootCanvas()
|
||||
.environment(appModel)
|
||||
.environment(appModel.voiceWake)
|
||||
.environment(bridgeController))
|
||||
}
|
||||
|
||||
hostCanvas()
|
||||
|
||||
appModel.bridgeStatusText = "Connecting…"
|
||||
hostCanvas()
|
||||
|
||||
appModel.bridgeStatusText = "Error: disconnected"
|
||||
hostCanvas()
|
||||
|
||||
appModel.bridgeServerName = "Mock Bridge"
|
||||
hostCanvas()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue