Skip to content

Commit

Permalink
Update text and element test IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
hueachilles committed Feb 20, 2024
1 parent 9cac72a commit 8846fd4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 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

0 comments on commit 8846fd4

Please sign in to comment.