Files
openclaw/apps/ios/Tests/SessionDashboardScreenTests.swift
Peter Steinberger 5e7cb225e4 fix(mobile): load pinned and base-path Control UI pages (#112175)
* fix(mobile): harden Control UI webviews

* refactor(mobile): keep native inventory stable

* docs(android): clarify shared pinned trust

* fix(ios): preserve encoded Control UI base paths
2026-07-21 08:19:07 -07:00

36 lines
1.2 KiB
Swift

import Foundation
import Testing
@testable import OpenClaw
@testable import OpenClawKit
@MainActor
struct SessionDashboardScreenTests {
@Test func `dashboard URL encodes the session and carries the one-shot face`() throws {
let config = try GatewayConnectConfig(
url: #require(URL(string: "wss://gateway.example.com:8443/tenant%2Fblue?old=true#fragment")),
stableID: "manual|gateway.example.com|8443",
tls: nil,
token: "secret-token",
bootstrapToken: nil,
password: nil,
nodeOptions: GatewayConnectOptions(
role: "node",
scopes: [],
caps: [],
commands: [],
permissions: [:],
clientId: "ios",
clientMode: "node",
clientDisplayName: "Phone"))
let url = SessionDashboardScreen.dashboardURL(
config: config,
sessionKey: "agent:main/phone & qa?x=1")
#expect(
url?.absoluteString ==
"https://gateway.example.com:8443/tenant%2Fblue/chat?session=agent%3Amain%2Fphone%20%26%20qa%3Fx%3D1&face=dashboard")
#expect(url?.absoluteString.contains("secret-token") == false)
}
}