Skip to content

Commit

Permalink
Merge pull request #103 from CrisisCleanup/update-text-test-ids
Browse files Browse the repository at this point in the history
Update text test ids
  • Loading branch information
hueachilles authored Feb 20, 2024
2 parents 9cac72a + 37042cd commit b551f76
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {

android {
defaultConfig {
val buildVersion = 187
val buildVersion = 188
applicationId = "com.crisiscleanup"
versionCode = buildVersion
versionName = "0.9.${buildVersion - 168}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class MainActivityViewModel @Inject constructor(
accountDataRefresher.updateAcceptedTerms()
} else {
val errorMessage = if (networkMonitor.isOnline.first()) {
translator("~~Something went wrong. Please try again later")
translator("~~Something went wrong. Please try again later.")
} else {
translator("~~Connect to the internet and try again.")
}
Expand Down
14 changes: 9 additions & 5 deletions app/src/main/java/com/crisiscleanup/ui/AcceptTermsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ internal fun AcceptTermsView(
// TODO Common dimensions
Modifier
.padding(16.dp)
.testTag("acceptTermsAgreeText"),
.testTag("acceptTermsAgreeAgreementText"),
)

AndroidView(
modifier = Modifier
.weight(1f)
.testTag("acceptTermsWebView"),
.testTag("acceptTermsAgreement"),
factory = { context ->
WebView(context).apply {
settings.javaScriptEnabled = true
Expand All @@ -75,7 +75,7 @@ internal fun AcceptTermsView(
if (errorMessage.isNotBlank()) {
Text(
errorMessage,
listItemModifier,
listItemModifier.testTag("acceptTermsErrorMessage"),
color = primaryRedColor,
)
}
Expand All @@ -87,11 +87,15 @@ internal fun AcceptTermsView(
Checkbox(
checked = isAcceptingTerms,
onCheckedChange = setAcceptingTerms,
modifier = Modifier.testTag("acceptTermsAcceptToggle"),
enabled = enable,
)
val acceptText = t("~~I accept the terms of service from {terms_url} ?")
val acceptText = t("~~I accept the terms of service from {terms_url}")
.replace("{terms_url}", termsOfServiceUrl)
LinkifyUrlText(acceptText)
LinkifyUrlText(
acceptText,
Modifier.testTag("acceptTermsAcceptText"),
)
}

FlowRow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private fun LoginWithEmailScreen(
}
}
BusyButton(
modifier = fillWidthPadded.testTag("loginLoginDebugBtn"),
modifier = fillWidthPadded.testTag("emailLoginDebugLoginAction"),
onClick = rememberDebugAuthenticate,
enabled = isNotBusy,
text = "Login debug",
Expand All @@ -209,7 +209,7 @@ private fun LoginWithEmailScreen(
}

BusyButton(
modifier = fillWidthPadded.testTag("loginLoginAction"),
modifier = fillWidthPadded.testTag("emailLoginLoginAction"),
onClick = viewModel::authenticateEmailPassword,
enabled = isNotBusy,
text = translator("actions.login", R.string.login),
Expand Down

0 comments on commit b551f76

Please sign in to comment.