2026-01-30 03:15:10 +01:00
|
|
|
import OpenClawDiscovery
|
2025-12-14 04:30:45 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
import Testing
|
2026-01-30 03:15:10 +01:00
|
|
|
@testable import OpenClaw
|
2025-12-14 04:30:45 +00:00
|
|
|
|
|
|
|
|
@Suite(.serialized)
|
|
|
|
|
@MainActor
|
|
|
|
|
struct OnboardingViewSmokeTests {
|
|
|
|
|
@Test func onboardingViewBuildsBody() {
|
|
|
|
|
let state = AppState(preview: true)
|
|
|
|
|
let view = OnboardingView(
|
|
|
|
|
state: state,
|
|
|
|
|
permissionMonitor: PermissionMonitor.shared,
|
2026-01-10 23:39:14 +01:00
|
|
|
discoveryModel: GatewayDiscoveryModel(localDisplayName: InstanceIdentity.displayName))
|
2025-12-14 04:30:45 +00:00
|
|
|
_ = view.body
|
|
|
|
|
}
|
2025-12-20 15:20:31 +00:00
|
|
|
|
2025-12-20 15:48:49 +00:00
|
|
|
@Test func pageOrderOmitsWorkspaceAndIdentitySteps() {
|
2026-01-16 07:58:30 +00:00
|
|
|
let order = OnboardingView.pageOrder(for: .local, showOnboardingChat: false)
|
2025-12-20 15:20:31 +00:00
|
|
|
#expect(!order.contains(7))
|
2026-01-03 16:04:19 +01:00
|
|
|
#expect(order.contains(3))
|
2025-12-20 15:20:31 +00:00
|
|
|
}
|
2025-12-20 16:51:33 +00:00
|
|
|
|
|
|
|
|
@Test func pageOrderOmitsOnboardingChatWhenIdentityKnown() {
|
2026-01-16 07:58:30 +00:00
|
|
|
let order = OnboardingView.pageOrder(for: .local, showOnboardingChat: false)
|
2025-12-20 16:51:33 +00:00
|
|
|
#expect(!order.contains(8))
|
|
|
|
|
}
|
2025-12-14 04:30:45 +00:00
|
|
|
}
|