2026-01-10 23:39:14 +01:00
|
|
|
import ClawdbotDiscovery
|
2025-12-14 04:30:45 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
import Testing
|
2026-01-04 14:32:47 +00:00
|
|
|
@testable import Clawdbot
|
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() {
|
2025-12-24 17:41:59 +01:00
|
|
|
let order = OnboardingView.pageOrder(for: .local, needsBootstrap: 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() {
|
2025-12-24 17:41:59 +01:00
|
|
|
let order = OnboardingView.pageOrder(for: .local, needsBootstrap: false)
|
2025-12-20 16:51:33 +00:00
|
|
|
#expect(!order.contains(8))
|
|
|
|
|
}
|
2025-12-14 04:30:45 +00:00
|
|
|
}
|