From 8846fd4263aa19f2d94a3e7eeb19a4877ce4c1d9 Mon Sep 17 00:00:00 2001 From: hue Date: Tue, 20 Feb 2024 13:17:42 -0500 Subject: [PATCH] Update text and element test IDs --- app/build.gradle.kts | 2 +- .../com/crisiscleanup/MainActivityViewModel.kt | 2 +- .../java/com/crisiscleanup/ui/AcceptTermsView.kt | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 56f6a9ad8..41f381b70 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -13,7 +13,7 @@ plugins { android { defaultConfig { - val buildVersion = 187 + val buildVersion = 188 applicationId = "com.crisiscleanup" versionCode = buildVersion versionName = "0.9.${buildVersion - 168}" diff --git a/app/src/main/java/com/crisiscleanup/MainActivityViewModel.kt b/app/src/main/java/com/crisiscleanup/MainActivityViewModel.kt index 555ec35f6..47dc46955 100644 --- a/app/src/main/java/com/crisiscleanup/MainActivityViewModel.kt +++ b/app/src/main/java/com/crisiscleanup/MainActivityViewModel.kt @@ -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.") } diff --git a/app/src/main/java/com/crisiscleanup/ui/AcceptTermsView.kt b/app/src/main/java/com/crisiscleanup/ui/AcceptTermsView.kt index 425d39379..0b44e917c 100644 --- a/app/src/main/java/com/crisiscleanup/ui/AcceptTermsView.kt +++ b/app/src/main/java/com/crisiscleanup/ui/AcceptTermsView.kt @@ -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 @@ -75,7 +75,7 @@ internal fun AcceptTermsView( if (errorMessage.isNotBlank()) { Text( errorMessage, - listItemModifier, + listItemModifier.testTag("acceptTermsErrorMessage"), color = primaryRedColor, ) } @@ -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(