Skip to content

Test the Cupcake app: Android Basics with Compose #109

@bielsnohr

Description

@bielsnohr

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#3

In which task and step of the codelab can this issue be found?

Task 4, Step 6

Describe the problem

The code snippet in the step is missing the import of the ComposeNavigator()

import androidx.compose.ui.platform.LocalContext

fun setupCupcakeNavHost() {
    composeTestRule.setContent {
        navController = TestNavHostController(LocalContext.current).apply {
            navigatorProvider.addNavigator(ComposeNavigator())
        }
        CupcakeApp(navController = navController)
    }
}

Steps to reproduce?

Copy the code snippet above into IDE and notice that ComposeNavigator() can't be resolved.

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