mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Automated rebrand of all openclaw references to hanzo bot: - Package: openclaw -> @hanzo/bot - Binary: openclaw -> hanzo-bot - Config: ~/.openclaw -> ~/.hanzo/bot - Docker: ghcr.io/hanzoai/bot - Env vars: OPENCLAW_* -> BOT_* - Bundle IDs: ai.hanzo.bot.* - Product name: Hanzo Bot
49 lines
1.7 KiB
Swift
49 lines
1.7 KiB
Swift
import SwiftUI
|
|
import Testing
|
|
@testable import Hanzo Bot
|
|
|
|
@Suite(.serialized)
|
|
@MainActor
|
|
struct TailscaleIntegrationSectionTests {
|
|
@Test func `tailscale section builds body when not installed`() {
|
|
let service = TailscaleService(isInstalled: false, isRunning: false, statusError: "not installed")
|
|
var view = TailscaleIntegrationSection(connectionMode: .local, isPaused: false)
|
|
view.setTestingService(service)
|
|
view.setTestingState(mode: "off", requireCredentials: false, statusMessage: "Idle")
|
|
_ = view.body
|
|
}
|
|
|
|
@Test func `tailscale section builds body for serve mode`() {
|
|
let service = TailscaleService(
|
|
isInstalled: true,
|
|
isRunning: true,
|
|
tailscaleHostname: "openclaw.tailnet.ts.net",
|
|
tailscaleIP: "100.64.0.1")
|
|
var view = TailscaleIntegrationSection(connectionMode: .local, isPaused: false)
|
|
view.setTestingService(service)
|
|
view.setTestingState(
|
|
mode: "serve",
|
|
requireCredentials: true,
|
|
password: "secret",
|
|
statusMessage: "Running")
|
|
_ = view.body
|
|
}
|
|
|
|
@Test func `tailscale section builds body for funnel mode`() {
|
|
let service = TailscaleService(
|
|
isInstalled: true,
|
|
isRunning: false,
|
|
tailscaleHostname: nil,
|
|
tailscaleIP: nil,
|
|
statusError: "not running")
|
|
var view = TailscaleIntegrationSection(connectionMode: .remote, isPaused: false)
|
|
view.setTestingService(service)
|
|
view.setTestingState(
|
|
mode: "funnel",
|
|
requireCredentials: false,
|
|
statusMessage: "Needs start",
|
|
validationMessage: "Invalid token")
|
|
_ = view.body
|
|
}
|
|
}
|