Files
openclaw/apps/macos/Tests/OpenClawIPCTests/AppLaunchPresentationPolicyTests.swift
Vincent Koc 9e0c5f94b5 fix(macos): support background-only launches (#112168)
* fix(macos): support background-only launches

* fix(macos): refresh native i18n inventory

* fix(i18n): refresh native inventory after main sync
2026-07-21 15:41:49 +08:00

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