Skip to content

Instantly share code, notes, and snippets.

val defaultTextColor: Color
@Composable
@ReadOnlyComposable
get() = if (isSystemInDarkTheme()) AP_White else AP_Ink
val defaultSecondaryTextColor: Color
@Composable
@ReadOnlyComposable
get() = if (isSystemInDarkTheme()) AP_Smoke else AP_Iron
@Composable
fun DebugNavHost(
navController: NavHostController,
paddingValues: PaddingValues,
showSnackBar: (String) -> Job
) {
MaterialThemeScreenContent {
val leprechaunViewModel = viewModel<LeprechaunViewModel>()
val progressOverlayViewModel = viewModel<ProgressOverlayViewModel>()
NavHost(navController, startDestination = DebugScreen.Environment.route, modifier = Modifier.padding(paddingValues)) {
@Config(application = PostApp::class, instrumentedPackages = ["androidx.loader.content"])
class AccountDetailsActivityTest :
RobolectricTestBase<AccountDetailsActivity>(AccountDetailsActivity::class) {
@get:Rule
val composeTestRule = createComposeRule()
private lateinit var page: AccountDetailsPage
@Before
class AccountDetailsPage constructor(private val composeTestRule: ComposeContentTestRule) {
val personalDetails: PersonalDetails
get() =
with(composeTestRule) {
PersonalDetails(
preferredName = TitleValue(
title = onNestedChild(UiAssert.stringRes(R.string.glam_preferred_name), "txt_title"),
value = onNestedChild(UiAssert.stringRes(R.string.glam_preferred_name), "txt_subtitle")
),
lastName = TitleValue(
APText(
modifier = Modifier
.testTag("txt_title")
.padding(top = 6.dp, bottom = 4.dp),
apStyle = textStyle, text = text, textColor = textColor
)