Skip to content

Test the Cupcake app: Android Basics with Compose #116

@LaEntropiaa

Description

@LaEntropiaa

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-test-cupcake?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-4-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-test-cupcake#4

In which task and step of the codelab can this issue be found?
In the task number 5, almost at the end of it

Describe the problem
Its not a big problem but the tests solutions the codelabs tells you to do on your own differ from the solution cod, for example:

See if you can write the tests to verify the following navigation states. Try implementing them on your own before looking at the solution.

  • Navigating to the Start screen by clicking the Up button from the Flavor screen
    (For this example you navigate from Flavor Screen to Start Screen, going back in the navigation)

@test
fun cupcakeNavHost_clickNextOnFlavorScreen_navigatesToPickupScreen() {
navigateToFlavorScreen()
composeTestRule.onNodeWithStringId(R.string.next)
.performClick()
navController.assertCurrentRouteName(CupcakeScreen.Pickup.name)
}

(The solution code provided navigates from Flavor Screen to PickUp Screen, goig up in the navigation)

As i said is not a big deal and only occurs with 2 of the test solutions

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions