mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Add default value for Failure.hasQuickFix
This commit is contained in:
+2
-2
@@ -82,7 +82,7 @@ class NotificationTroubleshootCheckPermissionTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
// Quick fix
|
// Quick fix
|
||||||
launch {
|
launch {
|
||||||
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
||||||
@@ -116,7 +116,7 @@ class NotificationTroubleshootCheckPermissionTestTest {
|
|||||||
sut.state.test {
|
sut.state.test {
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ class CurrentPushProviderTest(
|
|||||||
} else {
|
} else {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_current_push_provider_failure),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_current_push_provider_failure),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -54,7 +54,7 @@ class NotificationTest(
|
|||||||
} else {
|
} else {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_permission_failure),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_permission_failure),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ class NotificationTest(
|
|||||||
notificationDisplayer.dismissDiagnosticNotification()
|
notificationDisplayer.dismissDiagnosticNotification()
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_failure),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_failure),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
+4
-4
@@ -57,7 +57,7 @@ class PushLoopbackTest(
|
|||||||
val hasQuickFix = pushService.getCurrentPushProvider()?.canRotateToken() == true
|
val hasQuickFix = pushService.getCurrentPushProvider()?.canRotateToken() == true
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_1),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_1),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(hasQuickFix)
|
status = NotificationTroubleshootTestState.Status.Failure(hasQuickFix = hasQuickFix)
|
||||||
)
|
)
|
||||||
job.cancel()
|
job.cancel()
|
||||||
return
|
return
|
||||||
@@ -65,7 +65,7 @@ class PushLoopbackTest(
|
|||||||
Timber.e(e, "Failed to test push")
|
Timber.e(e, "Failed to test push")
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_2, e.message),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_2, e.message),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
job.cancel()
|
job.cancel()
|
||||||
return
|
return
|
||||||
@@ -73,7 +73,7 @@ class PushLoopbackTest(
|
|||||||
if (!testPushResult) {
|
if (!testPushResult) {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_3),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_3),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
job.cancel()
|
job.cancel()
|
||||||
return
|
return
|
||||||
@@ -94,7 +94,7 @@ class PushLoopbackTest(
|
|||||||
job.cancel()
|
job.cancel()
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_4),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_4),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ class PushProvidersTest(
|
|||||||
} else {
|
} else {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_detect_push_provider_failure),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_detect_push_provider_failure),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ class CurrentPushProviderTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -40,7 +40,7 @@ class PushLoopbackTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class PushLoopbackTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
}
|
}
|
||||||
@@ -97,10 +97,10 @@ class PushLoopbackTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
rotateTokenLambda.assertions().isCalledOnce()
|
rotateTokenLambda.assertions().isCalledOnce()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ class PushLoopbackTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ class PushLoopbackTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
assertThat(lastItem.description).contains(A_FAILURE_REASON)
|
assertThat(lastItem.description).contains(A_FAILURE_REASON)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ class PushProvidersTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ class FirebaseAvailabilityTest(
|
|||||||
} else {
|
} else {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_availability_failure),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_availability_failure),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ class FirebaseTokenTest(
|
|||||||
} else {
|
} else {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_token_failure),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_token_failure),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(true)
|
status = NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ class FirebaseAvailabilityTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -61,7 +61,7 @@ class FirebaseTokenTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
// Quick fix
|
// Quick fix
|
||||||
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
@@ -88,7 +88,7 @@ class FirebaseTokenTestTest {
|
|||||||
sut.state.test {
|
sut.state.test {
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -48,7 +48,7 @@ class UnifiedPushMatrixGatewayTest(
|
|||||||
if (config == null) {
|
if (config == null) {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = "No current push provider",
|
description = "No current push provider",
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
val gatewayBaseUrl = config.url.removeSuffix("/_matrix/push/v1/notify")
|
val gatewayBaseUrl = config.url.removeSuffix("/_matrix/push/v1/notify")
|
||||||
@@ -65,13 +65,13 @@ class UnifiedPushMatrixGatewayTest(
|
|||||||
} else {
|
} else {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = "${config.url} is not a Matrix gateway.",
|
description = "${config.url} is not a Matrix gateway.",
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} catch (throwable: Throwable) {
|
} catch (throwable: Throwable) {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = "Fail to check the gateway ${config.url}: ${throwable.localizedMessage}",
|
description = "Fail to check the gateway ${config.url}: ${throwable.localizedMessage}",
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(false)
|
status = NotificationTroubleshootTestState.Status.Failure()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ class UnifiedPushTest(
|
|||||||
} else {
|
} else {
|
||||||
delegate.updateState(
|
delegate.updateState(
|
||||||
description = stringProvider.getString(R.string.troubleshoot_notifications_test_unified_push_failure),
|
description = stringProvider.getString(R.string.troubleshoot_notifications_test_unified_push_failure),
|
||||||
status = NotificationTroubleshootTestState.Status.Failure(true)
|
status = NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -55,7 +55,7 @@ class UnifiedPushMatrixGatewayTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ class UnifiedPushMatrixGatewayTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
// Reset the error
|
// Reset the error
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
@@ -92,7 +92,7 @@ class UnifiedPushMatrixGatewayTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@ class UnifiedPushTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
// Quick fix
|
// Quick fix
|
||||||
launch {
|
launch {
|
||||||
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
|
||||||
@@ -99,7 +99,7 @@ class UnifiedPushTestTest {
|
|||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
|
||||||
val lastItem = awaitItem()
|
val lastItem = awaitItem()
|
||||||
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
|
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
|
||||||
sut.reset()
|
sut.reset()
|
||||||
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(false))
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ class NotificationTroubleshootTestDelegate(
|
|||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
NotificationTroubleshootTestState.Status.Success
|
NotificationTroubleshootTestState.Status.Success
|
||||||
} else {
|
} else {
|
||||||
NotificationTroubleshootTestState.Status.Failure(hasQuickFix)
|
NotificationTroubleshootTestState.Status.Failure(hasQuickFix = hasQuickFix)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ data class NotificationTroubleshootTestState(
|
|||||||
data object WaitingForUser : Status
|
data object WaitingForUser : Status
|
||||||
data object Success : Status
|
data object Success : Status
|
||||||
data class Failure(
|
data class Failure(
|
||||||
val hasQuickFix: Boolean,
|
val hasQuickFix: Boolean = false,
|
||||||
val isCritical: Boolean = true,
|
val isCritical: Boolean = true,
|
||||||
val quickFixButtonString: String? = null,
|
val quickFixButtonString: String? = null,
|
||||||
) : Status
|
) : Status
|
||||||
|
|||||||
Reference in New Issue
Block a user