mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 04:01:05 +00:00
* feat(ios): improve gateway connection error ux * fix(ios): address gateway problem review feedback * feat(ios): improve gateway connection error ux (#62650) (thanks @ngutman)
37 lines
1.2 KiB
Swift
37 lines
1.2 KiB
Swift
import OpenClawKit
|
|
import Testing
|
|
@testable import OpenClaw
|
|
|
|
@Suite struct GatewayStatusBuilderTests {
|
|
@Test func pausedProblemKeepsErrorStatus() {
|
|
let state = GatewayStatusBuilder.build(
|
|
gatewayServerName: nil,
|
|
lastGatewayProblem: GatewayConnectionProblem(
|
|
kind: .pairingRequired,
|
|
owner: .gateway,
|
|
title: "Pairing required",
|
|
message: "Approve this device before reconnecting.",
|
|
requestId: "req-123",
|
|
retryable: false,
|
|
pauseReconnect: true),
|
|
gatewayStatusText: "Reconnecting…")
|
|
|
|
#expect(state == .error)
|
|
}
|
|
|
|
@Test func transientProblemAllowsConnectingStatus() {
|
|
let state = GatewayStatusBuilder.build(
|
|
gatewayServerName: nil,
|
|
lastGatewayProblem: GatewayConnectionProblem(
|
|
kind: .timeout,
|
|
owner: .network,
|
|
title: "Connection timed out",
|
|
message: "The gateway did not respond before the connection timed out.",
|
|
retryable: true,
|
|
pauseReconnect: false),
|
|
gatewayStatusText: "Reconnecting…")
|
|
|
|
#expect(state == .connecting)
|
|
}
|
|
}
|