Files
bot/apps/macos/Tests/BotIPCTests/TailscaleIntegrationSectionTests.swift
zeekay 4bdc9ee3e4 chore: rebrand openclaw → hanzo-bot for bridge merge
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
2026-02-26 22:36:01 -08:00

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
}
}