mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
49 lines
1.7 KiB
Swift
49 lines
1.7 KiB
Swift
import SwiftUI
|
|
import Testing
|
|
@testable import HanzoBot
|
|
|
|
@Suite(.serialized)
|
|
@MainActor
|
|
struct TailscaleIntegrationSectionTests {
|
|
@Test func tailscaleSectionBuildsBodyWhenNotInstalled() {
|
|
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 tailscaleSectionBuildsBodyForServeMode() {
|
|
let service = TailscaleService(
|
|
isInstalled: true,
|
|
isRunning: true,
|
|
tailscaleHostname: "bot.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 tailscaleSectionBuildsBodyForFunnelMode() {
|
|
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
|
|
}
|
|
}
|