- 
                Notifications
    
You must be signed in to change notification settings  - Fork 177
 
Open
Description
Hi,
Given this view body:
NavigationStack(path: $appPathPublisher.path) {
            LoginView(viewModel: LoginViewModel(dependencies: dependencies, flow: self))
                .navigationDestination(for: AuthNavigationPath.self) { currentStep in
                    switch currentStep {
                    case .login:
                        LoginView(viewModel: LoginViewModel(dependencies: dependencies, flow: self))
                    case let .verify(email, password, token):
                        VerifyEmailView(viewModel: VerifyEmailViewModel(
                            email: email,
                            password: password,
                            token: token,
                            dependencies: dependencies,
                            flow: self
                        )).navigationBarBackButtonHidden().navigationBarHidden(true)
                    case .forgotPassword:
                        Text("Forgot Password")
                            .navigationBarBackButtonHidden()
                            .navigationBarHidden(true)
                    }
                }
        }
        .onAppear { self.isReadyForViewTesting?(self) } // 2.
How can we find that the VerifyEmailView has been presented? Running the debugger I can see that the currentStep is indeed .verify and that the VerifyEmailView has been constructed but I cannot find the view e.g. this cannot find the navigationDestination modifier
                let exp = flow.on(\.isReadyForViewTesting) { view in
            let loginView = try view.find(LoginView.self)
            let firstElement = try try self.flow.inspect().implicitAnyView().navigationStack(0)
            let result = try loginView.navigationDestination()
            
            let verifyView = try firstElement.find(VerifyEmailView.self)
            XCTAssertNotNil(verifyView)
        }
        ViewHosting.host(view: flow)
        defer { ViewHosting.expel() }
        wait(for: [exp], timeout: 0.1)
Please can I get some pointers? Thanks in advanced!
admin-stricta and r-comeau
Metadata
Metadata
Assignees
Labels
No labels