@@ -446,104 +446,6 @@ struct SwiftUIRenderSmokeTests {
446446 }
447447 }
448448
449- @ Test @ MainActor func `root tabs builds device orientation shell matrix` ( ) {
450- for scenario in Self . rootTabsShellScenarios ( ) {
451- let appModel = NodeAppModel ( )
452- let gatewayController = GatewayConnectionController ( appModel : appModel , startDiscovery : false )
453-
454- let root = RootTabs ( initialSidebarVisibility : scenario . sidebarVisible )
455- . environment ( AppAppearanceModel ( ) )
456- . environment ( appModel )
457- . environment ( appModel . voiceWake )
458- . environment ( gatewayController )
459- . environment ( \. horizontalSizeClass , scenario . horizontalSizeClass )
460- . environment ( \. verticalSizeClass , scenario . verticalSizeClass )
461-
462- _ = Self . host ( root , size : scenario . size )
463- }
464- }
465-
466- @ Test @ MainActor func `gateway quick setup builds candidate and empty states` ( ) {
467- let gateways : [ GatewayDiscoveryModel . DiscoveredGateway ? ] = [
468- . previewGateway ,
469- nil ,
470- ]
471-
472- for gateway in gateways {
473- let appModel = NodeAppModel ( )
474- let gatewayController = GatewayConnectionController ( appModel : appModel , startDiscovery : false )
475- if let gateway {
476- gatewayController . _test_setGateways ( [ gateway ] )
477- appModel . gatewayStatusText = " Ready to pair "
478- }
479-
480- let root = GatewayQuickSetupSheet ( )
481- . environment ( appModel )
482- . environment ( gatewayController )
483- . openClawSheetChrome ( )
484-
485- _ = Self . host ( root , size : CGSize ( width : 393 , height : 520 ) )
486- }
487- }
488-
489- @ Test @ MainActor func `onboarding activation screens build across appearance and type size` ( ) {
490- let screens : [ AnyView ] = [
491- AnyView ( OnboardingIntroStep ( onContinue : { } ) ) ,
492- AnyView ( OnboardingWelcomeStep (
493- statusLine : " " ,
494- isConnecting : false ,
495- onScanQRCode : { } ,
496- onManualSetup : { } ) ) ,
497- AnyView ( OnboardingSuccessStep (
498- gatewayName : " OpenClaw Gateway " ,
499- gatewayAddress : " openclaw.local " ,
500- onGetStarted : { } ) ) ,
501- AnyView ( NavigationStack {
502- Form {
503- Section ( " Connection Mode " ) {
504- OnboardingModeRow (
505- title : " Home Network " ,
506- subtitle : " LAN or Tailscale host " ,
507- symbol : " house.and.flag " ,
508- selected : true ,
509- action : { } )
510- OnboardingModeRow (
511- title : " Remote Domain " ,
512- subtitle : " VPS with domain " ,
513- symbol : " globe " ,
514- selected : false ,
515- action : { } )
516- }
517- }
518- . scrollContentBackground ( . hidden )
519- . background ( OpenClawBrand . activationCanvas )
520- } ) ,
521- ]
522-
523- for scheme in [ ColorScheme . light , ColorScheme . dark ] {
524- for screen in screens {
525- let root = screen
526- . preferredColorScheme ( scheme )
527- . environment ( \. dynamicTypeSize , . accessibility2 )
528- _ = Self . host ( root , size : CGSize ( width : 393 , height : 852 ) )
529- }
530- }
531- }
532-
533- @ Test @ MainActor func `root tabs build gateway state view hierarchies` ( ) {
534- for appModel in Self . rootTabsGatewayStateModels ( ) {
535- let gatewayController = GatewayConnectionController ( appModel : appModel , startDiscovery : false )
536-
537- let root = RootTabs ( )
538- . environment ( AppAppearanceModel ( ) )
539- . environment ( appModel )
540- . environment ( appModel . voiceWake )
541- . environment ( gatewayController )
542-
543- _ = Self . host ( root )
544- }
545- }
546-
547449 @ Test @ MainActor func `gateway trust prompt alert presents when prompt appears after initial render` ( ) async {
548450 let appModel = NodeAppModel ( )
549451 let gatewayController = Self . gatewayControllerWithCapturedTLSFingerprint ( appModel : appModel )
@@ -643,77 +545,6 @@ struct SwiftUIRenderSmokeTests {
643545 await controller . connectManual ( host : host , port : port , useTLS : true )
644546 }
645547
646- @ Test @ MainActor func `root sidebar builds gateway state view hierarchies` ( ) {
647- for appModel in Self . rootTabsGatewayStateModels ( ) {
648- let root = RootSidebar (
649- model : RootSidebarModel ( ) ,
650- selectedDestination : . overview ,
651- isDrawerLayout : true ,
652- isDismissButtonEnabled : true ,
653- selectDestination : { _ in } ,
654- hideSidebar : { } )
655- . environment ( appModel )
656-
657- _ = Self . host ( root , size : CGSize ( width : 340 , height : 852 ) )
658- }
659- }
660-
661- @ Test @ MainActor func `root sidebar builds landscape compact state` ( ) {
662- let appModel = NodeAppModel ( )
663- let root = RootSidebar (
664- model : RootSidebarModel ( ) ,
665- selectedDestination : . chat ,
666- isDrawerLayout : true ,
667- isDismissButtonEnabled : true ,
668- selectDestination : { _ in } ,
669- hideSidebar : { } )
670- . environment ( appModel )
671- . environment ( \. horizontalSizeClass , . regular )
672- . environment ( \. verticalSizeClass , . compact )
673-
674- _ = Self . host ( root , size : CGSize ( width : 340 , height : 393 ) )
675- }
676-
677- @ Test @ MainActor func `routed sidebar screens build offline states` ( ) {
678- let appModel = NodeAppModel ( )
679- let screens : [ AnyView ] = [
680- AnyView ( CommandCenterTab ( openChat : { } , openSettings : { } ) ) ,
681- AnyView ( IPadActivityScreen ( openChat : { } , openSettings : { } ) ) ,
682- AnyView ( OpenClawDocsScreen ( ) ) ,
683- AnyView ( IPadWorkboardScreen ( openChat : { } , openSettings : { } ) ) ,
684- AnyView ( IPadSkillWorkshopScreen ( openSettings : { } ) ) ,
685- AnyView ( AgentProTab ( directRoute : . agents ) ) ,
686- AnyView ( AgentProTab ( directRoute : . instances ) ) ,
687- AnyView ( CommandSessionsScreen ( openChat : { } ) ) ,
688- AnyView ( AgentProTab ( directRoute : . dreaming ) ) ,
689- AnyView ( AgentProTab ( directRoute : . usage ) ) ,
690- AnyView ( AgentProTab ( directRoute : . cron ) ) ,
691- ]
692-
693- for screen in screens {
694- let root = NavigationStack { screen }
695- . environment ( appModel )
696- _ = Self . host ( root )
697- }
698- }
699-
700- @ Test @ MainActor func `task screens build phone landscape compact states` ( ) {
701- let appModel = NodeAppModel ( )
702- let screens : [ AnyView ] = [
703- AnyView ( IPadWorkboardScreen ( openChat : { } , openSettings : { } ) ) ,
704- AnyView ( IPadSkillWorkshopScreen ( openSettings : { } ) ) ,
705- ]
706-
707- for screen in screens {
708- let root = NavigationStack { screen }
709- . environment ( appModel )
710- . environment ( \. horizontalSizeClass , . regular )
711- . environment ( \. verticalSizeClass , . compact )
712-
713- _ = Self . host ( root )
714- }
715- }
716-
717548 @ MainActor private static func waitForPresentedAlert ( in window : UIWindow ) async {
718549 for _ in 0 ..< 10 {
719550 if window . rootViewController ? . presentedViewController != nil { return }
@@ -722,72 +553,4 @@ struct SwiftUIRenderSmokeTests {
722553 }
723554 }
724555
725- @ MainActor private static func rootTabsGatewayStateModels ( ) -> [ NodeAppModel ] {
726- let offlineModel = NodeAppModel ( )
727-
728- let connectingModel = NodeAppModel ( )
729- connectingModel . gatewayStatusText = " Connecting... "
730-
731- let connectedModel = NodeAppModel ( )
732- connectedModel . enterAppleReviewDemoMode ( )
733-
734- let errorModel = NodeAppModel ( )
735- errorModel . gatewayStatusText = " Gateway error: connection refused "
736-
737- return [ offlineModel , connectingModel , connectedModel , errorModel ]
738- }
739-
740- private static func rootTabsShellScenarios ( ) -> [ RootTabsShellScenario ] {
741- [
742- RootTabsShellScenario (
743- size : CGSize ( width : 393 , height : 852 ) ,
744- horizontalSizeClass : . compact ,
745- verticalSizeClass : . regular ,
746- sidebarVisible : false ) ,
747- RootTabsShellScenario (
748- size : CGSize ( width : 393 , height : 852 ) ,
749- horizontalSizeClass : . compact ,
750- verticalSizeClass : . regular ,
751- sidebarVisible : true ) ,
752- RootTabsShellScenario (
753- size : CGSize ( width : 852 , height : 393 ) ,
754- horizontalSizeClass : . regular ,
755- verticalSizeClass : . compact ,
756- sidebarVisible : false ) ,
757- RootTabsShellScenario (
758- size : CGSize ( width : 1024 , height : 1366 ) ,
759- horizontalSizeClass : . regular ,
760- verticalSizeClass : . regular ,
761- sidebarVisible : true ) ,
762- RootTabsShellScenario (
763- size : CGSize ( width : 1366 , height : 1024 ) ,
764- horizontalSizeClass : . regular ,
765- verticalSizeClass : . regular ,
766- sidebarVisible : true ) ,
767- ]
768- }
769-
770- private struct RootTabsShellScenario {
771- let size : CGSize
772- let horizontalSizeClass : UserInterfaceSizeClass
773- let verticalSizeClass : UserInterfaceSizeClass
774- let sidebarVisible : Bool
775- }
776- }
777-
778- extension GatewayDiscoveryModel . DiscoveredGateway {
779- fileprivate static let previewGateway = GatewayDiscoveryModel . DiscoveredGateway (
780- name : " Studio Gateway " ,
781- endpoint : . hostPort (
782- host : . name ( " openclaw.local " , nil ) ,
783- port : 18789 ) ,
784- stableID : " preview-gateway " ,
785- debugID : " openclaw.local " ,
786- lanHost : " openclaw.local " ,
787- tailnetDns : nil ,
788- gatewayPort : 18789 ,
789- canvasPort : 18789 ,
790- tlsEnabled : true ,
791- tlsFingerprintSha256 : " preview " ,
792- cliPath : " /opt/homebrew/bin/openclaw " )
793556}
0 commit comments