test: cover macos location permission status
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
### Fixes
|
||||
- Android: tapping the foreground service notification brings the app to the front. (#179) — thanks @Syhids
|
||||
- Cron tool passes `id` to the gateway for update/remove/run/runs (keeps `jobId` input). (#180) — thanks @adamgall
|
||||
- macOS: treat location permission as always-only to avoid iOS-only enums. (#165) — thanks @Nachx639
|
||||
|
||||
|
||||
## 2026.1.4
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Testing
|
||||
import ClawdbotIPC
|
||||
import CoreLocation
|
||||
@testable import Clawdbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@@ -22,4 +23,16 @@ struct PermissionManagerTests {
|
||||
let ensured = await PermissionManager.ensure(caps, interactive: false)
|
||||
#expect(ensured.keys.count == caps.count)
|
||||
}
|
||||
|
||||
@Test func locationStatusMatchesAuthorizationAlways() async {
|
||||
let status = CLLocationManager().authorizationStatus
|
||||
let results = await PermissionManager.status([.location])
|
||||
#expect(results[.location] == (status == .authorizedAlways))
|
||||
}
|
||||
|
||||
@Test func ensureLocationNonInteractiveMatchesAuthorizationAlways() async {
|
||||
let status = CLLocationManager().authorizationStatus
|
||||
let ensured = await PermissionManager.ensure([.location], interactive: false)
|
||||
#expect(ensured[.location] == (status == .authorizedAlways))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user