Git Product home page Git Product logo

Comments (4)

raamcosta avatar raamcosta commented on May 20, 2024

Hi @asrieltiago ! 👋

Thanks for reporting.
So yeah, this is something I haven't had time to fiddle with, unfortunately.
The one thing I can think of is that you can create a DestinationsNavigator like this:

     val navController = TestNavHostController(ApplicationProvider.getApplicationContext())

     fun destinationsNavigator(navBackStackEntry: NavBackStackEntry): DestinationsNavigator {
         return DestinationsNavController(navController, navBackStackEntry)
     }
    
    //...
        DestinationsNavHost(navGraph = NavGraphs.root, navController = navController)

I'm not sure if this helps or not. I'd have to fully understand what you're trying to do, so I can test on my side.
Is this an open-source project I can take a look at?
From my understanding, you want to test after navigating if the Parcelable args are correct on the other side?

from compose-destinations.

raamcosta avatar raamcosta commented on May 20, 2024

Or you can create an implementation of DestinationsNavigator any way you want since it is an interface. Again.. not sure if this helps 😅

from compose-destinations.

asrieltiago avatar asrieltiago commented on May 20, 2024

I made the UI test work, following your idea of creating a class inheriting from the DestinationsNavigator interface.

image
image

In the end it was something simple, thanks for the quick answer and maybe this will help the next ones who are going to test the UI.

from compose-destinations.

raamcosta avatar raamcosta commented on May 20, 2024

If you need an empty implementation of DestinationsNavigator, the library has an EmptyDestinationsNavigator 😅
I thought you wanted to test navigating specifically! Yeah if all you need to test is screens on their own, then this will work for you!

from compose-destinations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.