Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build an adaptive app with adaptive layout: Android Basics with Compose - missing step #117

Open
AndroidiaCoUk opened this issue Sep 18, 2024 · 0 comments

Comments

@AndroidiaCoUk
Copy link

For this test to work:
// Verify that third email is displayed on the details screen composeTestRule.onNodeWithTagForStringId(R.string.details_screen).onChildren() .assertAny(hasAnyDescendant(hasText( composeTestRule.activity.getString(LocalEmailsDataProvider.allEmails[2].body))) )
the details_screen testTag needs to be added to the modifier in (at least) a couple of places. In ReplyHomeScreen.kt
} else { val replyScreenDetailsContentDescription = stringResource(R.string.details_screen) ReplyDetailsScreen( replyUiState = replyUiState, isFullScreen = true, onBackPressed = onDetailScreenBackPressed, modifier = modifier .testTag(replyScreenDetailsContentDescription) ) }
and in ReplyHomeContent.kt
val activity = LocalContext.current as Activity val replyScreenDetailsContentDescription = stringResource(R.string.details_screen) ReplyDetailsScreen( replyUiState = replyUiState, modifier = Modifier .testTag(replyScreenDetailsContentDescription) .padding(top = dimensionResource(R.dimen.email_list_item_vertical_spacing)) .weight(1f), onBackPressed = { activity.finish() } )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant