mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test(macos): remove body-only view probes (#121820)
* test(macos): remove body-only view probes * test(macos): drop retired i18n wrapper contract
This commit is contained in:
committed by
GitHub
parent
ebfd3ba154
commit
69220fc0d4
@@ -157,26 +157,3 @@ struct SettingsCardToggleRow: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SettingsToggleRow: View {
|
|
||||||
let title: SettingsTextValue
|
|
||||||
let subtitle: SettingsTextValue?
|
|
||||||
@Binding var binding: Bool
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
VStack(alignment: .leading, spacing: 6) {
|
|
||||||
Toggle(isOn: self.$binding) {
|
|
||||||
self.title.text
|
|
||||||
.font(.body)
|
|
||||||
}
|
|
||||||
.toggleStyle(.checkbox)
|
|
||||||
|
|
||||||
if let subtitle {
|
|
||||||
subtitle.text
|
|
||||||
.font(.footnote)
|
|
||||||
.foregroundStyle(.tertiary)
|
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
import OpenClawProtocol
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Testing
|
import Testing
|
||||||
@testable import OpenClaw
|
@testable import OpenClaw
|
||||||
@@ -7,51 +6,6 @@ import Testing
|
|||||||
@Suite(.serialized)
|
@Suite(.serialized)
|
||||||
@MainActor
|
@MainActor
|
||||||
struct LowCoverageViewSmokeTests {
|
struct LowCoverageViewSmokeTests {
|
||||||
@Test func `context root menu label builds body`() {
|
|
||||||
let longStatus = "Gateway connection dropped; gateway likely restarted and needs a few seconds to reconnect."
|
|
||||||
_ = ContextRootMenuLabelView(subtitle: longStatus, width: 320).body
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test func `settings toggle row builds body`() {
|
|
||||||
var flag = false
|
|
||||||
let binding = Binding(get: { flag }, set: { flag = $0 })
|
|
||||||
let view = SettingsToggleRow(title: "Enable", subtitle: "Detail", binding: binding)
|
|
||||||
_ = view.body
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test func `voice wake test card builds body across states`() {
|
|
||||||
var state = VoiceWakeTestState.idle
|
|
||||||
var isTesting = false
|
|
||||||
let stateBinding = Binding(get: { state }, set: { state = $0 })
|
|
||||||
let testingBinding = Binding(get: { isTesting }, set: { isTesting = $0 })
|
|
||||||
|
|
||||||
_ = VoiceWakeTestCard(testState: stateBinding, isTesting: testingBinding, onToggle: {}).body
|
|
||||||
|
|
||||||
state = .hearing("hello")
|
|
||||||
_ = VoiceWakeTestCard(testState: stateBinding, isTesting: testingBinding, onToggle: {}).body
|
|
||||||
|
|
||||||
state = .detected("command")
|
|
||||||
isTesting = true
|
|
||||||
_ = VoiceWakeTestCard(testState: stateBinding, isTesting: testingBinding, onToggle: {}).body
|
|
||||||
|
|
||||||
state = .failed("No mic")
|
|
||||||
_ = VoiceWakeTestCard(testState: stateBinding, isTesting: testingBinding, onToggle: {}).body
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test func `agent events window builds body with event`() {
|
|
||||||
AgentEventStore.shared.clear()
|
|
||||||
let sample = ControlAgentEvent(
|
|
||||||
runId: "run-1",
|
|
||||||
seq: 1,
|
|
||||||
stream: "tool",
|
|
||||||
ts: Date().timeIntervalSince1970 * 1000,
|
|
||||||
data: ["phase": AnyCodable("start"), "name": AnyCodable("test")],
|
|
||||||
summary: nil)
|
|
||||||
AgentEventStore.shared.append(sample)
|
|
||||||
_ = AgentEventsWindow().body
|
|
||||||
AgentEventStore.shared.clear()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test func `notify overlay keeps replacement visible`() async {
|
@Test func `notify overlay keeps replacement visible`() async {
|
||||||
let controller = NotifyOverlayController()
|
let controller = NotifyOverlayController()
|
||||||
controller.present(title: "Hello", body: "World", autoDismissAfter: 0.05)
|
controller.present(title: "Hello", body: "World", autoDismissAfter: 0.05)
|
||||||
|
|||||||
@@ -6,81 +6,6 @@ import Testing
|
|||||||
@Suite(.serialized)
|
@Suite(.serialized)
|
||||||
@MainActor
|
@MainActor
|
||||||
struct SettingsViewSmokeTests {
|
struct SettingsViewSmokeTests {
|
||||||
@Test func `cron settings builds body`() {
|
|
||||||
let store = CronJobsStore(isPreview: true)
|
|
||||||
store.schedulerEnabled = false
|
|
||||||
store.schedulerStorePath = "/tmp/openclaw-cron-store.json"
|
|
||||||
|
|
||||||
let job1 = CronJob(
|
|
||||||
id: "job-1",
|
|
||||||
agentId: "ops",
|
|
||||||
name: " Morning Check-in ",
|
|
||||||
description: nil,
|
|
||||||
enabled: true,
|
|
||||||
deleteAfterRun: nil,
|
|
||||||
createdAtMs: 1_700_000_000_000,
|
|
||||||
updatedAtMs: 1_700_000_100_000,
|
|
||||||
schedule: .cron(expr: "0 8 * * *", tz: "UTC"),
|
|
||||||
sessionTarget: .main,
|
|
||||||
wakeMode: .now,
|
|
||||||
payload: .systemEvent(text: "ping"),
|
|
||||||
delivery: nil,
|
|
||||||
state: CronJobState(
|
|
||||||
nextRunAtMs: 1_700_000_200_000,
|
|
||||||
runningAtMs: nil,
|
|
||||||
lastRunAtMs: 1_700_000_050_000,
|
|
||||||
lastStatus: "ok",
|
|
||||||
lastError: nil,
|
|
||||||
lastDurationMs: 123))
|
|
||||||
|
|
||||||
let job2 = CronJob(
|
|
||||||
id: "job-2",
|
|
||||||
agentId: nil,
|
|
||||||
name: "",
|
|
||||||
description: nil,
|
|
||||||
enabled: false,
|
|
||||||
deleteAfterRun: nil,
|
|
||||||
createdAtMs: 1_700_000_000_000,
|
|
||||||
updatedAtMs: 1_700_000_100_000,
|
|
||||||
schedule: .every(everyMs: 30000, anchorMs: nil),
|
|
||||||
sessionTarget: .isolated,
|
|
||||||
wakeMode: .nextHeartbeat,
|
|
||||||
payload: .agentTurn(
|
|
||||||
message: "hello",
|
|
||||||
thinking: "low",
|
|
||||||
timeoutSeconds: 30,
|
|
||||||
deliver: nil,
|
|
||||||
channel: nil,
|
|
||||||
to: nil,
|
|
||||||
bestEffortDeliver: nil),
|
|
||||||
delivery: CronDelivery(mode: .announce, channel: "sms", to: "+15551234567", bestEffort: true),
|
|
||||||
state: CronJobState(
|
|
||||||
nextRunAtMs: nil,
|
|
||||||
runningAtMs: nil,
|
|
||||||
lastRunAtMs: nil,
|
|
||||||
lastStatus: nil,
|
|
||||||
lastError: nil,
|
|
||||||
lastDurationMs: nil))
|
|
||||||
|
|
||||||
store.jobs = [job1, job2]
|
|
||||||
store.selectedJobId = job1.id
|
|
||||||
store.runEntries = [
|
|
||||||
CronRunLogEntry(
|
|
||||||
ts: 1_700_000_050_000,
|
|
||||||
jobId: job1.id,
|
|
||||||
action: "finished",
|
|
||||||
status: "ok",
|
|
||||||
error: nil,
|
|
||||||
summary: "ok",
|
|
||||||
runAtMs: 1_700_000_050_000,
|
|
||||||
durationMs: 123,
|
|
||||||
nextRunAtMs: 1_700_000_200_000),
|
|
||||||
]
|
|
||||||
|
|
||||||
let view = CronSettings(store: store)
|
|
||||||
_ = view.body
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test func `cron settings renders in hosting view`() {
|
@Test func `cron settings renders in hosting view`() {
|
||||||
let store = CronJobsStore(isPreview: true)
|
let store = CronJobsStore(isPreview: true)
|
||||||
store.schedulerEnabled = false
|
store.schedulerEnabled = false
|
||||||
@@ -145,12 +70,6 @@ struct SettingsViewSmokeTests {
|
|||||||
_ = view.body
|
_ = view.body
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test func `general settings builds body`() {
|
|
||||||
let state = AppState(preview: true)
|
|
||||||
let view = GeneralSettings(state: state)
|
|
||||||
_ = view.body
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test func `connection settings builds body`() {
|
@Test func `connection settings builds body`() {
|
||||||
let state = AppState(preview: true)
|
let state = AppState(preview: true)
|
||||||
let view = GeneralSettings(state: state, page: .connection)
|
let view = GeneralSettings(state: state, page: .connection)
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ const LOCALIZED_WRAPPER_CONTRACTS: Record<string, readonly string[]> = {
|
|||||||
"struct SettingsCardGroup<Content: View>: View {\n let title: SettingsTextValue",
|
"struct SettingsCardGroup<Content: View>: View {\n let title: SettingsTextValue",
|
||||||
"struct SettingsCardRow<Content: View>: View {\n let title: SettingsTextValue\n let subtitle: SettingsTextValue?",
|
"struct SettingsCardRow<Content: View>: View {\n let title: SettingsTextValue\n let subtitle: SettingsTextValue?",
|
||||||
"struct SettingsCardToggleRow: View {\n let title: SettingsTextValue\n let subtitle: SettingsTextValue?",
|
"struct SettingsCardToggleRow: View {\n let title: SettingsTextValue\n let subtitle: SettingsTextValue?",
|
||||||
"struct SettingsToggleRow: View {\n let title: SettingsTextValue\n let subtitle: SettingsTextValue?",
|
|
||||||
"Text(verbatim: value)",
|
"Text(verbatim: value)",
|
||||||
],
|
],
|
||||||
"apps/ios/Sources/Design/OpenClawProComponents.swift": [
|
"apps/ios/Sources/Design/OpenClawProComponents.swift": [
|
||||||
|
|||||||
Reference in New Issue
Block a user