test: cover macos location permission status

This commit is contained in:
Peter Steinberger
2026-01-04 18:46:57 +01:00
parent 50cecd8210
commit 5dcf43d6ad
2 changed files with 14 additions and 0 deletions

View File

@@ -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

View File

@@ -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))
}
}