From 09b2cbaaf5f4c993e79adf5122d6541d661f6c6b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 27 Mar 2024 18:16:47 +0100 Subject: [PATCH] Localize Troubleshoot notification feature. --- .../notifications/NotificationSettingsView.kt | 4 +-- .../TroubleshootNotificationsView.kt | 22 +++++++++------ .../impl/src/main/res/values/localazy.xml | 10 +++++++ ...ficationTroubleshootCheckPermissionTest.kt | 7 +++-- .../impl/src/main/res/values/localazy.xml | 5 ++++ ...tionTroubleshootCheckPermissionTestTest.kt | 10 +++++-- .../troubleshoot/CurrentPushProviderTest.kt | 11 +++++--- .../impl/troubleshoot/NotificationTest.kt | 17 ++++++----- .../impl/troubleshoot/PushLoopbackTest.kt | 17 ++++++----- .../impl/troubleshoot/PushProvidersTest.kt | 16 ++++++++--- .../impl/src/main/res/values/localazy.xml | 24 ++++++++++++++++ .../CurrentPushProviderTestTest.kt | 7 +++-- .../impl/troubleshoot/NotificationTestTest.kt | 4 ++- .../impl/troubleshoot/PushLoopbackTestTest.kt | 19 +++++++------ .../troubleshoot/PushProvidersTestTest.kt | 4 +++ .../pushproviders/firebase/build.gradle.kts | 3 ++ .../troubleshoot/FirebaseAvailabilityTest.kt | 11 +++++--- .../troubleshoot/FirebaseTokenTest.kt | 14 +++++++--- .../firebase/src/main/res/values/localazy.xml | 11 ++++++++ .../FirebaseAvailabilityTestTest.kt | 7 +++-- .../troubleshoot/FirebaseTokenTestTest.kt | 3 ++ .../unifiedpush/build.gradle.kts | 2 ++ .../troubleshoot/UnifiedPushTest.kt | 16 ++++++++--- .../src/main/res/values/localazy.xml | 10 +++++++ .../troubleshoot/UnifiedPushTestTest.kt | 3 ++ tools/localazy/config.json | 28 +++++++++++++++++-- 26 files changed, 221 insertions(+), 64 deletions(-) create mode 100644 libraries/permissions/impl/src/main/res/values/localazy.xml create mode 100644 libraries/pushproviders/firebase/src/main/res/values/localazy.xml create mode 100644 libraries/pushproviders/unifiedpush/src/main/res/values/localazy.xml diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt index 8f59ffcdba..5e3610b652 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt @@ -166,10 +166,10 @@ private fun NotificationSettingsContentView( onCheckedChange = onInviteForMeNotificationsChanged ) } - PreferenceCategory(title = "Troubleshoot") { + PreferenceCategory(title = stringResource(id = R.string.troubleshoot_notifications_entry_point_section)) { PreferenceText( modifier = Modifier, - title = "Troubleshoot notifications", + title = stringResource(id = R.string.troubleshoot_notifications_entry_point_title), onClick = onTroubleshootNotificationsClicked ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsView.kt index cadffa1ba0..451b4f778e 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsView.kt @@ -21,11 +21,13 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.progressSemantics import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons +import io.element.android.features.preferences.impl.R import io.element.android.libraries.architecture.AsyncAction import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState.Status @@ -63,7 +65,7 @@ fun TroubleshootNotificationsView( PreferencePage( modifier = modifier, onBackPressed = onBackPressed, - title = "Troubleshoot notifications", + title = stringResource(id = R.string.troubleshoot_notifications_screen_title), ) { TroubleshootNotificationsContent(state) } @@ -120,7 +122,7 @@ private fun TroubleshootTestView( }, trailingContent = ListItemContent.Custom { Button( - text = "Attempt to fix", + text = stringResource(id = R.string.troubleshoot_notifications_screen_quick_fix_action), onClick = onQuickFixClicked ) } @@ -148,8 +150,7 @@ private fun TroubleshootNotificationsContent(state: TroubleshootNotificationsSta AsyncAction.Uninitialized -> { ListItem(headlineContent = { Text( - text = "Run the tests to detect any issue in your configuration " + - "that may make notifications not behave as expected." + text = stringResource(id = R.string.troubleshoot_notifications_screen_notice) ) }) RunTestButton(state = state) @@ -157,21 +158,21 @@ private fun TroubleshootNotificationsContent(state: TroubleshootNotificationsSta AsyncAction.Loading -> Unit is AsyncAction.Failure -> { ListItem(headlineContent = { - Text(text = "Some tests failed, please check the details.") + Text(text = stringResource(id = R.string.troubleshoot_notifications_screen_failure)) }) RunTestButton(state = state) } AsyncAction.Confirming -> { ListItem(headlineContent = { Text( - text = "Some tests require your attention. Please check the details." + text = stringResource(id = R.string.troubleshoot_notifications_screen_waiting) ) }) } is AsyncAction.Success -> { ListItem(headlineContent = { Text( - text = "All tests passed successfully." + text = stringResource(id = R.string.troubleshoot_notifications_screen_success) ) }) } @@ -183,7 +184,12 @@ private fun RunTestButton(state: TroubleshootNotificationsState) { ListItem( headlineContent = { Button( - text = if (state.testSuiteState.mainState is AsyncAction.Failure) "Run tests again" else "Run tests", + text = stringResource( + id = if (state.testSuiteState.mainState is AsyncAction.Failure) + R.string.troubleshoot_notifications_screen_action_again + else + R.string.troubleshoot_notifications_screen_action + ), onClick = { state.eventSink(TroubleshootNotificationsEvents.StartTests) }, diff --git a/features/preferences/impl/src/main/res/values/localazy.xml b/features/preferences/impl/src/main/res/values/localazy.xml index 492c75295a..b0e78e0d9e 100644 --- a/features/preferences/impl/src/main/res/values/localazy.xml +++ b/features/preferences/impl/src/main/res/values/localazy.xml @@ -49,4 +49,14 @@ If you proceed, some of your settings may change." "system settings" "System notifications turned off" "Notifications" + "Troubleshoot" + "Troubleshoot notifications" + "Run tests" + "Run tests again" + "Some tests failed. Please check the details." + "Run the tests to detect any issue in your configuration that may make notifications not behave as expected." + "Attempt to fix" + "All tests passed successfully." + "Troubleshoot notifications" + "Some tests require your attention. Please check the details." diff --git a/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt b/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt index f158ccbabd..903b5cd2c4 100644 --- a/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt +++ b/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt @@ -24,8 +24,10 @@ import io.element.android.libraries.core.notifications.NotificationTroubleshootT import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope import io.element.android.libraries.permissions.api.PermissionStateProvider +import io.element.android.libraries.permissions.impl.R import io.element.android.libraries.permissions.impl.action.PermissionActions import io.element.android.services.toolbox.api.sdk.BuildVersionSdkIntProvider +import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow import javax.inject.Inject @@ -35,12 +37,13 @@ class NotificationTroubleshootCheckPermissionTest @Inject constructor( private val permissionStateProvider: PermissionStateProvider, private val sdkVersionProvider: BuildVersionSdkIntProvider, private val permissionActions: PermissionActions, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { override val order: Int = 0 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Check permissions", - defaultDescription = "Ensure that the application can show notifications.", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_check_permission_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_check_permission_description), hasQuickFix = true, fakeDelay = NotificationTroubleshootTestDelegate.SHORT_DELAY, ) diff --git a/libraries/permissions/impl/src/main/res/values/localazy.xml b/libraries/permissions/impl/src/main/res/values/localazy.xml new file mode 100644 index 0000000000..a8859205dc --- /dev/null +++ b/libraries/permissions/impl/src/main/res/values/localazy.xml @@ -0,0 +1,5 @@ + + + "Ensure that the application can show notifications." + "Check permissions" + diff --git a/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt b/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt index 80c07e2ce0..c17e61f5e7 100644 --- a/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt +++ b/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt @@ -23,6 +23,7 @@ import io.element.android.libraries.core.notifications.NotificationTroubleshootT import io.element.android.libraries.permissions.impl.FakePermissionStateProvider import io.element.android.libraries.permissions.impl.action.FakePermissionActions import io.element.android.services.toolbox.test.sdk.FakeBuildVersionSdkIntProvider +import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Test @@ -33,7 +34,8 @@ class NotificationTroubleshootCheckPermissionTestTest { val sut = NotificationTroubleshootCheckPermissionTest( permissionStateProvider = FakePermissionStateProvider(), sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkInt = Build.VERSION_CODES.TIRAMISU - 1), - permissionActions = FakePermissionActions() + permissionActions = FakePermissionActions(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -51,7 +53,8 @@ class NotificationTroubleshootCheckPermissionTestTest { val sut = NotificationTroubleshootCheckPermissionTest( permissionStateProvider = FakePermissionStateProvider(), sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkInt = Build.VERSION_CODES.TIRAMISU), - permissionActions = FakePermissionActions() + permissionActions = FakePermissionActions(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -77,7 +80,8 @@ class NotificationTroubleshootCheckPermissionTestTest { val sut = NotificationTroubleshootCheckPermissionTest( permissionStateProvider = permissionStateProvider, sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkInt = Build.VERSION_CODES.TIRAMISU), - permissionActions = actions + permissionActions = actions, + stringProvider = FakeStringProvider(), ) launch { sut.run(this) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt index 32f99edd13..7a819b3d93 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt @@ -22,6 +22,8 @@ import io.element.android.libraries.core.notifications.NotificationTroubleshootT import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope import io.element.android.libraries.push.api.GetCurrentPushProvider +import io.element.android.libraries.push.impl.R +import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow import javax.inject.Inject @@ -29,11 +31,12 @@ import javax.inject.Inject @ContributesMultibinding(AppScope::class) class CurrentPushProviderTest @Inject constructor( private val getCurrentPushProvider: GetCurrentPushProvider, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { override val order = 110 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Current push provider", - defaultDescription = "Get the name of the current provider.", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_current_push_provider_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_current_push_provider_description), fakeDelay = NotificationTroubleshootTestDelegate.SHORT_DELAY, ) override val state: StateFlow = delegate.state @@ -43,12 +46,12 @@ class CurrentPushProviderTest @Inject constructor( val provider = getCurrentPushProvider.getCurrentPushProvider() if (provider != null) { delegate.updateState( - description = "Current push provider: $provider", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_current_push_provider_success, provider), status = NotificationTroubleshootTestState.Status.Success ) } else { delegate.updateState( - description = "No push providers selected", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_current_push_provider_failure), status = NotificationTroubleshootTestState.Status.Failure(false) ) } diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt index d2bf0b160d..d7e3641e22 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt @@ -21,8 +21,10 @@ import io.element.android.libraries.core.notifications.NotificationTroubleshootT import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope +import io.element.android.libraries.push.impl.R import io.element.android.libraries.push.impl.notifications.NotificationDisplayer import io.element.android.libraries.push.impl.notifications.factories.NotificationCreator +import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.first @@ -36,12 +38,13 @@ import kotlin.time.Duration.Companion.seconds class NotificationTest @Inject constructor( private val notificationCreator: NotificationCreator, private val notificationDisplayer: NotificationDisplayer, - private val notificationClickHandler: NotificationClickHandler + private val notificationClickHandler: NotificationClickHandler, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { override val order = 50 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Display notification", - defaultDescription = "Check that the application can display notification", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_description), fakeDelay = NotificationTroubleshootTestDelegate.SHORT_DELAY, ) override val state: StateFlow = delegate.state @@ -53,12 +56,12 @@ class NotificationTest @Inject constructor( if (result) { coroutineScope.listenToNotificationClick() delegate.updateState( - description = "Please click on the notification to continue the test.", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_waiting), status = NotificationTroubleshootTestState.Status.WaitingForUser ) } else { delegate.updateState( - description = "Cannot display the notification.", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_permission_failure), status = NotificationTroubleshootTestState.Status.Failure(false) ) } @@ -76,12 +79,12 @@ class NotificationTest @Inject constructor( if (s == null) { notificationDisplayer.dismissDiagnosticNotification() delegate.updateState( - description = "The notification has not been clicked.", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_failure), status = NotificationTroubleshootTestState.Status.Failure(false) ) } else { delegate.updateState( - description = "The notification has been clicked!", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_success), status = NotificationTroubleshootTestState.Status.Success ) } diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt index b4323b612f..2ecec61996 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt @@ -23,6 +23,8 @@ import io.element.android.libraries.core.notifications.NotificationTroubleshootT import io.element.android.libraries.di.AppScope import io.element.android.libraries.push.api.PushService import io.element.android.libraries.push.api.gateway.PushGatewayFailure +import io.element.android.libraries.push.impl.R +import io.element.android.services.toolbox.api.strings.StringProvider import io.element.android.services.toolbox.api.systemclock.SystemClock import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.CoroutineScope @@ -39,11 +41,12 @@ class PushLoopbackTest @Inject constructor( private val pushService: PushService, private val diagnosticPushHandler: DiagnosticPushHandler, private val clock: SystemClock, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { override val order = 500 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Test Push loopback", - defaultDescription = "Ensure that the application is receiving push.", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_description), ) override val state: StateFlow = delegate.state @@ -59,7 +62,7 @@ class PushLoopbackTest @Inject constructor( pushService.testPush() } catch (pusherRejected: PushGatewayFailure.PusherRejected) { delegate.updateState( - description = "Error: pusher has rejected the request.", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_1), status = NotificationTroubleshootTestState.Status.Failure(false) ) job.cancel() @@ -67,7 +70,7 @@ class PushLoopbackTest @Inject constructor( } catch (e: Exception) { Timber.e(e, "Failed to test push") delegate.updateState( - description = "Error: ${e.message}.", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_2, e.message), status = NotificationTroubleshootTestState.Status.Failure(false) ) job.cancel() @@ -75,7 +78,7 @@ class PushLoopbackTest @Inject constructor( } if (!testPushResult) { delegate.updateState( - description = "Error, cannot test push.", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_3), status = NotificationTroubleshootTestState.Status.Failure(false) ) job.cancel() @@ -87,12 +90,12 @@ class PushLoopbackTest @Inject constructor( job.cancel() if (result == null) { delegate.updateState( - description = "Error, timeout waiting for push.", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_4), status = NotificationTroubleshootTestState.Status.Failure(false) ) } else { delegate.updateState( - description = "Push loopback took $result ms", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_success, result), status = NotificationTroubleshootTestState.Status.Success ) } diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt index bbcee50a54..df6d220396 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt @@ -21,7 +21,9 @@ import io.element.android.libraries.core.notifications.NotificationTroubleshootT import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope +import io.element.android.libraries.push.impl.R import io.element.android.libraries.pushproviders.api.PushProvider +import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow import javax.inject.Inject @@ -29,12 +31,13 @@ import javax.inject.Inject @ContributesMultibinding(AppScope::class) class PushProvidersTest @Inject constructor( pushProviders: Set<@JvmSuppressWildcards PushProvider>, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { private val sortedPushProvider = pushProviders.sortedBy { it.index } override val order = 100 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Detect push providers", - defaultDescription = "Ensure that the application has at least one push provider.", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_detect_push_provider_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_detect_push_provider_description), fakeDelay = NotificationTroubleshootTestDelegate.SHORT_DELAY, ) override val state: StateFlow = delegate.state @@ -44,12 +47,17 @@ class PushProvidersTest @Inject constructor( val result = sortedPushProvider.isNotEmpty() if (result) { delegate.updateState( - description = "Found ${sortedPushProvider.size} push providers: ${sortedPushProvider.joinToString { it.name }}", + description = stringProvider.getQuantityString( + resId = R.plurals.troubleshoot_notifications_test_detect_push_provider_success, + quantity = sortedPushProvider.size, + sortedPushProvider.size, + sortedPushProvider.joinToString { it.name } + ), status = NotificationTroubleshootTestState.Status.Success ) } else { delegate.updateState( - description = "No push providers found", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_detect_push_provider_failure), status = NotificationTroubleshootTestState.Status.Failure(false) ) } diff --git a/libraries/push/impl/src/main/res/values/localazy.xml b/libraries/push/impl/src/main/res/values/localazy.xml index ed49f5edd8..c9d7627d07 100644 --- a/libraries/push/impl/src/main/res/values/localazy.xml +++ b/libraries/push/impl/src/main/res/values/localazy.xml @@ -50,4 +50,28 @@ "Background synchronization" "Google Services" "No valid Google Play Services found. Notifications may not work properly." + "Get the name of the current provider." + "No push providers selected." + "Current push provider: %1$s." + "Current push provider" + "Ensure that the application has at least one push provider." + "No push providers found." + + "Found %1$d push provider: %2$s" + "Found %1$d push providers: %2$s" + + "Detect push providers" + "Check that the application can display notification." + "The notification has not been clicked." + "Cannot display the notification." + "The notification has been clicked!" + "Display notification" + "Please click on the notification to continue the test." + "Ensure that the application is receiving push." + "Error: pusher has rejected the request." + "Error: %1$s." + "Error, cannot test push." + "Error, timeout waiting for push." + "Push loop back took %1$d ms." + "Test Push loop back" diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt index 8506d826b5..ea8de71222 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt @@ -20,6 +20,7 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.push.test.FakeGetCurrentPushProvider +import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Test @@ -28,7 +29,8 @@ class CurrentPushProviderTestTest { @Test fun `test CurrentPushProviderTest with a push provider`() = runTest { val sut = CurrentPushProviderTest( - getCurrentPushProvider = FakeGetCurrentPushProvider("foo") + getCurrentPushProvider = FakeGetCurrentPushProvider("foo"), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -45,7 +47,8 @@ class CurrentPushProviderTestTest { @Test fun `test CurrentPushProviderTest without push provider`() = runTest { val sut = CurrentPushProviderTest( - getCurrentPushProvider = FakeGetCurrentPushProvider(null) + getCurrentPushProvider = FakeGetCurrentPushProvider(null), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt index 0a4ac2d066..a900d50b1f 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt @@ -21,6 +21,7 @@ import com.google.common.truth.Truth.assertThat import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.push.impl.notifications.fake.MockkNotificationCreator import io.element.android.libraries.push.impl.notifications.fake.MockkNotificationDisplayer +import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Test @@ -82,7 +83,8 @@ class NotificationTestTest { return NotificationTest( notificationCreator = mockkNotificationCreator.instance, notificationDisplayer = mockkNotificationDisplayer.instance, - notificationClickHandler = notificationClickHandler + notificationClickHandler = notificationClickHandler, + stringProvider = FakeStringProvider(), ) } } diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt index 354ec60bb9..01fe2b9847 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt @@ -23,6 +23,7 @@ import io.element.android.libraries.matrix.test.AN_EXCEPTION import io.element.android.libraries.matrix.test.A_FAILURE_REASON import io.element.android.libraries.push.api.gateway.PushGatewayFailure import io.element.android.libraries.push.test.FakePushService +import io.element.android.services.toolbox.test.strings.FakeStringProvider import io.element.android.services.toolbox.test.systemclock.FakeSystemClock import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest @@ -35,7 +36,8 @@ class PushLoopbackTestTest { val sut = PushLoopbackTest( pushService = FakePushService(), diagnosticPushHandler = diagnosticPushHandler, - clock = FakeSystemClock() + clock = FakeSystemClock(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -45,7 +47,6 @@ class PushLoopbackTestTest { assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress) val lastItem = awaitItem() assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false)) - assertThat(lastItem.description).contains("timeout") } } @@ -59,7 +60,8 @@ class PushLoopbackTestTest { } ), diagnosticPushHandler = diagnosticPushHandler, - clock = FakeSystemClock() + clock = FakeSystemClock(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -69,7 +71,6 @@ class PushLoopbackTestTest { assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress) val lastItem = awaitItem() assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false)) - assertThat(lastItem.description).contains("rejected") } } @@ -81,7 +82,8 @@ class PushLoopbackTestTest { testPushBlock = { false } ), diagnosticPushHandler = diagnosticPushHandler, - clock = FakeSystemClock() + clock = FakeSystemClock(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -91,7 +93,6 @@ class PushLoopbackTestTest { assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress) val lastItem = awaitItem() assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false)) - assertThat(lastItem.description).contains("cannot test push") } } @@ -105,7 +106,8 @@ class PushLoopbackTestTest { } ), diagnosticPushHandler = diagnosticPushHandler, - clock = FakeSystemClock() + clock = FakeSystemClock(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -128,7 +130,8 @@ class PushLoopbackTestTest { true }), diagnosticPushHandler = diagnosticPushHandler, - clock = FakeSystemClock() + clock = FakeSystemClock(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt index 644392c11b..cf7f750403 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt @@ -20,6 +20,7 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.test.FakePushProvider +import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Test @@ -29,6 +30,7 @@ class PushProvidersTestTest { fun `test PushProvidersTest with empty list`() = runTest { val sut = PushProvidersTest( pushProviders = emptySet(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -48,6 +50,7 @@ class PushProvidersTestTest { FakePushProvider(name = "foo"), FakePushProvider(name = "bar"), ), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -57,6 +60,7 @@ class PushProvidersTestTest { assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress) val lastItem = awaitItem() assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Success) + assertThat(lastItem.description).contains("2") assertThat(lastItem.description).contains("foo") assertThat(lastItem.description).contains("bar") } diff --git a/libraries/pushproviders/firebase/build.gradle.kts b/libraries/pushproviders/firebase/build.gradle.kts index 55dca139b0..de19420923 100644 --- a/libraries/pushproviders/firebase/build.gradle.kts +++ b/libraries/pushproviders/firebase/build.gradle.kts @@ -40,6 +40,8 @@ dependencies { implementation(projects.libraries.core) implementation(projects.libraries.di) implementation(projects.libraries.matrix.api) + implementation(projects.libraries.uiStrings) + implementation(projects.services.toolbox.api) implementation(projects.libraries.pushstore.api) implementation(projects.libraries.pushproviders.api) @@ -57,4 +59,5 @@ dependencies { testImplementation(libs.test.turbine) testImplementation(projects.libraries.matrix.test) testImplementation(projects.tests.testutils) + testImplementation(projects.services.toolbox.test) } diff --git a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt index acd907fb0a..64a5bad67f 100644 --- a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt +++ b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt @@ -24,6 +24,8 @@ import io.element.android.libraries.core.notifications.TestFilterData import io.element.android.libraries.di.AppScope import io.element.android.libraries.pushproviders.firebase.FirebaseConfig import io.element.android.libraries.pushproviders.firebase.IsPlayServiceAvailable +import io.element.android.libraries.pushproviders.firebase.R +import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow import javax.inject.Inject @@ -31,11 +33,12 @@ import javax.inject.Inject @ContributesMultibinding(AppScope::class) class FirebaseAvailabilityTest @Inject constructor( private val isPlayServiceAvailable: IsPlayServiceAvailable, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { override val order = 300 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Check Firebase", - defaultDescription = "Ensure that Firebase is available.", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_availability_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_availability_description), visibleWhenIdle = false, fakeDelay = NotificationTroubleshootTestDelegate.LONG_DELAY, ) @@ -50,12 +53,12 @@ class FirebaseAvailabilityTest @Inject constructor( val result = isPlayServiceAvailable.isAvailable() if (result) { delegate.updateState( - description = "Firebase is available", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_availability_success), status = NotificationTroubleshootTestState.Status.Success ) } else { delegate.updateState( - description = "Firebase is not available", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_availability_failure), status = NotificationTroubleshootTestState.Status.Failure(false) ) } diff --git a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt index e501ce1e9d..b2164cda32 100644 --- a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt +++ b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt @@ -25,6 +25,8 @@ import io.element.android.libraries.di.AppScope import io.element.android.libraries.pushproviders.firebase.FirebaseConfig import io.element.android.libraries.pushproviders.firebase.FirebaseStore import io.element.android.libraries.pushproviders.firebase.FirebaseTroubleshooter +import io.element.android.libraries.pushproviders.firebase.R +import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow import javax.inject.Inject @@ -33,11 +35,12 @@ import javax.inject.Inject class FirebaseTokenTest @Inject constructor( private val firebaseStore: FirebaseStore, private val firebaseTroubleshooter: FirebaseTroubleshooter, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { override val order = 310 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Check Firebase token", - defaultDescription = "Ensure that Firebase token is available.", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_token_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_token_description), visibleWhenIdle = false, fakeDelay = NotificationTroubleshootTestDelegate.LONG_DELAY, ) @@ -52,12 +55,15 @@ class FirebaseTokenTest @Inject constructor( val token = firebaseStore.getFcmToken() if (token != null) { delegate.updateState( - description = "Firebase token: ${token.take(8)}*****", + description = stringProvider.getString( + R.string.troubleshoot_notifications_test_firebase_token_success, + "${token.take(8)}*****" + ), status = NotificationTroubleshootTestState.Status.Success ) } else { delegate.updateState( - description = "Firebase token is not known", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_token_failure), status = NotificationTroubleshootTestState.Status.Failure(true) ) } diff --git a/libraries/pushproviders/firebase/src/main/res/values/localazy.xml b/libraries/pushproviders/firebase/src/main/res/values/localazy.xml new file mode 100644 index 0000000000..654ba04134 --- /dev/null +++ b/libraries/pushproviders/firebase/src/main/res/values/localazy.xml @@ -0,0 +1,11 @@ + + + "Ensure that Firebase is available." + "Firebase is not available." + "Firebase is available." + "Check Firebase" + "Ensure that Firebase token is available." + "Firebase token is not known." + "Firebase token: %1$s." + "Check Firebase token" + diff --git a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt index eea622849b..0c742fa567 100644 --- a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt +++ b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt @@ -20,6 +20,7 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.firebase.IsPlayServiceAvailable +import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Test @@ -32,7 +33,8 @@ class FirebaseAvailabilityTestTest { override fun isAvailable(): Boolean { return true } - } + }, + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -52,7 +54,8 @@ class FirebaseAvailabilityTestTest { override fun isAvailable(): Boolean { return false } - } + }, + stringProvider = FakeStringProvider(), ) launch { sut.run(this) diff --git a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt index 0463939234..b76e6861fc 100644 --- a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt +++ b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt @@ -21,6 +21,7 @@ import com.google.common.truth.Truth.assertThat import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.firebase.FakeFirebaseTroubleshooter import io.element.android.libraries.pushproviders.firebase.InMemoryFirebaseStore +import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Test @@ -31,6 +32,7 @@ class FirebaseTokenTestTest { val sut = FirebaseTokenTest( firebaseStore = InMemoryFirebaseStore(FAKE_TOKEN), firebaseTroubleshooter = FakeFirebaseTroubleshooter(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -56,6 +58,7 @@ class FirebaseTokenTestTest { Result.success(Unit) } ), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) diff --git a/libraries/pushproviders/unifiedpush/build.gradle.kts b/libraries/pushproviders/unifiedpush/build.gradle.kts index ecceed6026..190c63d350 100644 --- a/libraries/pushproviders/unifiedpush/build.gradle.kts +++ b/libraries/pushproviders/unifiedpush/build.gradle.kts @@ -32,6 +32,7 @@ dependencies { implementation(projects.libraries.androidutils) implementation(projects.libraries.core) implementation(projects.libraries.matrix.api) + implementation(projects.libraries.uiStrings) implementation(projects.libraries.pushstore.api) implementation(projects.libraries.pushproviders.api) @@ -57,4 +58,5 @@ dependencies { testImplementation(libs.test.turbine) testImplementation(projects.libraries.matrix.test) testImplementation(projects.tests.testutils) + testImplementation(projects.services.toolbox.test) } diff --git a/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt b/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt index df79030c44..ec3b95e437 100644 --- a/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt +++ b/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt @@ -22,8 +22,10 @@ import io.element.android.libraries.core.notifications.NotificationTroubleshootT import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.core.notifications.TestFilterData import io.element.android.libraries.di.AppScope +import io.element.android.libraries.pushproviders.unifiedpush.R import io.element.android.libraries.pushproviders.unifiedpush.UnifiedPushConfig import io.element.android.libraries.pushproviders.unifiedpush.UnifiedPushDistributorProvider +import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow import javax.inject.Inject @@ -32,11 +34,12 @@ import javax.inject.Inject class UnifiedPushTest @Inject constructor( private val unifiedPushDistributorProvider: UnifiedPushDistributorProvider, private val openDistributorWebPageAction: OpenDistributorWebPageAction, + private val stringProvider: StringProvider, ) : NotificationTroubleshootTest { override val order = 400 private val delegate = NotificationTroubleshootTestDelegate( - defaultName = "Check UnifiedPush", - defaultDescription = "Ensure that UnifiedPush distributors are available.", + defaultName = stringProvider.getString(R.string.troubleshoot_notifications_test_unified_push_title), + defaultDescription = stringProvider.getString(R.string.troubleshoot_notifications_test_unified_push_description), visibleWhenIdle = false, fakeDelay = NotificationTroubleshootTestDelegate.SHORT_DELAY, ) @@ -51,12 +54,17 @@ class UnifiedPushTest @Inject constructor( val distributors = unifiedPushDistributorProvider.getDistributors() if (distributors.isNotEmpty()) { delegate.updateState( - description = "Distributors found: ${distributors.joinToString { it.name }}", + description = stringProvider.getQuantityString( + resId = R.plurals.troubleshoot_notifications_test_unified_push_success, + quantity = distributors.size, + distributors.size, + distributors.joinToString { it.name } + ), status = NotificationTroubleshootTestState.Status.Success ) } else { delegate.updateState( - description = "No push distributors found", + description = stringProvider.getString(R.string.troubleshoot_notifications_test_unified_push_failure), status = NotificationTroubleshootTestState.Status.Failure(true) ) } diff --git a/libraries/pushproviders/unifiedpush/src/main/res/values/localazy.xml b/libraries/pushproviders/unifiedpush/src/main/res/values/localazy.xml new file mode 100644 index 0000000000..0e16af1f3e --- /dev/null +++ b/libraries/pushproviders/unifiedpush/src/main/res/values/localazy.xml @@ -0,0 +1,10 @@ + + + "Ensure that UnifiedPush distributors are available." + "No push distributors found." + + "%1$d distributor found: %2$s." + "%1$d distributors found: %2$s." + + "Check UnifiedPush" + diff --git a/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt b/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt index e7a8ccc680..29301515cd 100644 --- a/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt +++ b/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt @@ -20,6 +20,7 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.api.Distributor +import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Test @@ -34,6 +35,7 @@ class UnifiedPushTestTest { ) ), openDistributorWebPageAction = FakeOpenDistributorWebPageAction(), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) @@ -60,6 +62,7 @@ class UnifiedPushTestTest { ) } ), + stringProvider = FakeStringProvider(), ) launch { sut.run(this) diff --git a/tools/localazy/config.json b/tools/localazy/config.json index aaa1f6734b..603c04b55c 100644 --- a/tools/localazy/config.json +++ b/tools/localazy/config.json @@ -80,7 +80,29 @@ "name" : ":libraries:push:impl", "includeRegex" : [ "push_.*", - "notification_.*" + "notification_.*", + "troubleshoot_notifications_test_current_push_provider.*", + "troubleshoot_notifications_test_detect_push_provider.*", + "troubleshoot_notifications_test_display_notification_.*", + "troubleshoot_notifications_test_push_loop_back_.*" + ] + }, + { + "name" : ":libraries:permissions:impl", + "includeRegex" : [ + "troubleshoot_notifications_test_check_permission_.*" + ] + }, + { + "name" : ":libraries:pushproviders:firebase", + "includeRegex" : [ + "troubleshoot_notifications_test_firebase_.*" + ] + }, + { + "name" : ":libraries:pushproviders:unifiedpush", + "includeRegex" : [ + "troubleshoot_notifications_test_unified_push_.*" ] }, { @@ -182,7 +204,9 @@ "screen\\.advanced_settings\\..*", "screen_edit_profile_.*", "screen_notification_settings_.*", - "screen_blocked_users_.*" + "screen_blocked_users_.*", + "troubleshoot_notifications_entry_point_.*", + "troubleshoot_notifications_screen_.*" ] }, {