mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
9e0c5f94b5
* fix(macos): support background-only launches * fix(macos): refresh native i18n inventory * fix(i18n): refresh native inventory after main sync
30 lines
1.2 KiB
Swift
30 lines
1.2 KiB
Swift
import Testing
|
|
@testable import OpenClaw
|
|
|
|
struct AppLaunchPresentationPolicyTests {
|
|
@Test func `normal launches allow automatic presentation`() {
|
|
let policy = AppLaunchPresentationPolicy(arguments: ["OpenClaw"])
|
|
|
|
#expect(policy.allowsAutomaticPresentation)
|
|
#expect(policy.shouldAutoOpenChat(arguments: ["OpenClaw", "--chat"]))
|
|
#expect(policy.shouldAutoOpenDashboard(arguments: ["OpenClaw", "--dashboard"]))
|
|
}
|
|
|
|
@Test func `background-only wins over automatic presentation flags`() {
|
|
let arguments = ["OpenClaw", "--background-only", "--chat", "--dashboard"]
|
|
let policy = AppLaunchPresentationPolicy(arguments: arguments)
|
|
|
|
#expect(!policy.allowsAutomaticPresentation)
|
|
#expect(!policy.shouldAutoOpenChat(arguments: arguments))
|
|
#expect(!policy.shouldAutoOpenDashboard(arguments: arguments))
|
|
}
|
|
|
|
@Test func `attach-only does not change presentation behavior`() {
|
|
let arguments = ["OpenClaw", "--attach-only", "--dashboard"]
|
|
let policy = AppLaunchPresentationPolicy(arguments: arguments)
|
|
|
|
#expect(policy.allowsAutomaticPresentation)
|
|
#expect(policy.shouldAutoOpenDashboard(arguments: arguments))
|
|
}
|
|
}
|