Add notification troubleshoot test about blocked users.

This commit is contained in:
Benoit Marty 2025-09-22 20:12:26 +02:00
parent a7fb213ff7
commit c4d7d42141
31 changed files with 338 additions and 30 deletions

View file

@ -22,5 +22,6 @@ interface NotificationTroubleShootEntryPoint : FeatureEntryPoint {
interface Callback : Plugin {
fun onDone()
fun openIgnoredUsers()
}
}

View file

@ -0,0 +1,12 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.troubleshoot.api.test
interface NotificationTroubleshootNavigator {
fun openIgnoredUsers()
}

View file

@ -16,7 +16,10 @@ interface NotificationTroubleshootTest {
fun isRelevant(data: TestFilterData): Boolean = true
suspend fun run(coroutineScope: CoroutineScope)
suspend fun reset()
suspend fun quickFix(coroutineScope: CoroutineScope) {
suspend fun quickFix(
coroutineScope: CoroutineScope,
navigator: NotificationTroubleshootNavigator,
) {
error("Quick fix not implemented, you need to override this method in your test")
}
}

View file

@ -17,6 +17,10 @@ data class NotificationTroubleshootTestState(
data object InProgress : Status
data object WaitingForUser : Status
data object Success : Status
data class Failure(val hasQuickFix: Boolean) : Status
data class Failure(
val hasQuickFix: Boolean,
val isCritical: Boolean = true,
val quickFixButtonString: String? = null,
) : Status
}
}