mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 15:01:41 +03:00
iOS: wire node services and tests
This commit is contained in:
committed by
Mariano Belinky
parent
3711143549
commit
7b0a0f3dac
@@ -61,6 +61,11 @@ private func withUserDefaults<T>(_ updates: [String: Any?], _ body: () throws ->
|
||||
#expect(caps.contains(OpenClawCapability.camera.rawValue))
|
||||
#expect(caps.contains(OpenClawCapability.location.rawValue))
|
||||
#expect(caps.contains(OpenClawCapability.voiceWake.rawValue))
|
||||
#expect(caps.contains(OpenClawCapability.device.rawValue))
|
||||
#expect(caps.contains(OpenClawCapability.photos.rawValue))
|
||||
#expect(caps.contains(OpenClawCapability.contacts.rawValue))
|
||||
#expect(caps.contains(OpenClawCapability.calendar.rawValue))
|
||||
#expect(caps.contains(OpenClawCapability.reminders.rawValue))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,4 +81,40 @@ private func withUserDefaults<T>(_ updates: [String: Any?], _ body: () throws ->
|
||||
#expect(commands.contains(OpenClawLocationCommand.get.rawValue))
|
||||
}
|
||||
}
|
||||
|
||||
@Test @MainActor func currentCommandsExcludeShellAndIncludeNotifyAndDevice() {
|
||||
withUserDefaults([
|
||||
"node.instanceId": "ios-test",
|
||||
]) {
|
||||
let appModel = NodeAppModel()
|
||||
let controller = GatewayConnectionController(appModel: appModel, startDiscovery: false)
|
||||
let commands = Set(controller._test_currentCommands())
|
||||
|
||||
#expect(commands.contains(OpenClawSystemCommand.notify.rawValue))
|
||||
#expect(!commands.contains(OpenClawSystemCommand.run.rawValue))
|
||||
#expect(!commands.contains(OpenClawSystemCommand.which.rawValue))
|
||||
#expect(!commands.contains(OpenClawSystemCommand.execApprovalsGet.rawValue))
|
||||
#expect(!commands.contains(OpenClawSystemCommand.execApprovalsSet.rawValue))
|
||||
|
||||
#expect(commands.contains(OpenClawDeviceCommand.status.rawValue))
|
||||
#expect(commands.contains(OpenClawDeviceCommand.info.rawValue))
|
||||
}
|
||||
}
|
||||
|
||||
@Test @MainActor func currentPermissionsIncludeExpectedKeys() {
|
||||
let appModel = NodeAppModel()
|
||||
let controller = GatewayConnectionController(appModel: appModel, startDiscovery: false)
|
||||
let permissions = controller._test_currentPermissions()
|
||||
let keys = Set(permissions.keys)
|
||||
|
||||
#expect(keys.contains("camera"))
|
||||
#expect(keys.contains("microphone"))
|
||||
#expect(keys.contains("location"))
|
||||
#expect(keys.contains("screenRecording"))
|
||||
#expect(keys.contains("photos"))
|
||||
#expect(keys.contains("contacts"))
|
||||
#expect(keys.contains("calendar"))
|
||||
#expect(keys.contains("reminders"))
|
||||
#expect(keys.contains("motion"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user