mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
Revert "iOS: align node permissions and notifications"
This reverts commit b17e6fdd07.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import OpenClawKit
|
||||
import AVFoundation
|
||||
import CoreLocation
|
||||
import Foundation
|
||||
import Testing
|
||||
import UIKit
|
||||
@@ -78,41 +76,4 @@ private func withUserDefaults<T>(_ updates: [String: Any?], _ body: () throws ->
|
||||
#expect(commands.contains(OpenClawLocationCommand.get.rawValue))
|
||||
}
|
||||
}
|
||||
|
||||
@Test @MainActor func currentCommandsExcludeSystemExecButKeepNotify() {
|
||||
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) == false)
|
||||
#expect(commands.contains(OpenClawSystemCommand.which.rawValue) == false)
|
||||
#expect(commands.contains(OpenClawSystemCommand.execApprovalsGet.rawValue) == false)
|
||||
#expect(commands.contains(OpenClawSystemCommand.execApprovalsSet.rawValue) == false)
|
||||
}
|
||||
}
|
||||
|
||||
@Test @MainActor func currentPermissionsIncludeExpectedKeys() {
|
||||
let provider = GatewayConnectionController.PermissionStatusProvider(
|
||||
cameraStatus: { .authorized },
|
||||
microphoneStatus: { .denied },
|
||||
locationStatus: { .authorizedWhenInUse },
|
||||
locationServicesEnabled: { true },
|
||||
screenRecordingAvailable: { false })
|
||||
|
||||
let appModel = NodeAppModel()
|
||||
let controller = GatewayConnectionController(
|
||||
appModel: appModel,
|
||||
startDiscovery: false,
|
||||
permissionProvider: provider)
|
||||
let permissions = controller._test_currentPermissions()
|
||||
|
||||
#expect(permissions["camera"] == true)
|
||||
#expect(permissions["microphone"] == false)
|
||||
#expect(permissions["location"] == true)
|
||||
#expect(permissions["screenRecording"] == false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user