mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:40:43 +00:00
Merged via squash.
Prepared head SHA: 8a3ca92150
Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com>
Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com>
Reviewed-by: @ngutman
32 lines
1.1 KiB
Swift
32 lines
1.1 KiB
Swift
import AppKit
|
|
import Testing
|
|
@testable import OpenClaw
|
|
|
|
@Suite(.serialized)
|
|
@MainActor
|
|
struct ExecApprovalPromptLayoutTests {
|
|
@Test func `accessory view reserves nonzero alert layout space`() {
|
|
let accessory = ExecApprovalsPromptPresenter.buildAccessoryView(
|
|
ExecApprovalPromptRequest(
|
|
command: "/bin/sh -lc \"hostname; uptime; echo '---'\"",
|
|
cwd: "/Users/example/projects/openclaw",
|
|
host: "node",
|
|
security: "allowlist",
|
|
ask: "on-miss",
|
|
agentId: "main",
|
|
resolvedPath: "/bin/sh",
|
|
sessionKey: "session-1"))
|
|
|
|
#expect(accessory.frame.width >= 380)
|
|
#expect(accessory.frame.height >= 160)
|
|
|
|
let alert = NSAlert()
|
|
alert.messageText = "Allow this command?"
|
|
alert.informativeText = "Review the command details before allowing."
|
|
alert.accessoryView = accessory
|
|
|
|
#expect(alert.accessoryView?.frame.width == accessory.frame.width)
|
|
#expect(alert.accessoryView?.frame.height == accessory.frame.height)
|
|
}
|
|
}
|