Skip to content

Commit a83fc2a

Browse files
committed
Add default value for Failure.hasQuickFix
1 parent fa14e4c commit a83fc2a

File tree

18 files changed

+34
-34
lines changed

18 files changed

+34
-34
lines changed

libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class NotificationTroubleshootCheckPermissionTestTest {
8282
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
8383
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
8484
val lastItem = awaitItem()
85-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
85+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
8686
// Quick fix
8787
launch {
8888
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
@@ -116,7 +116,7 @@ class NotificationTroubleshootCheckPermissionTestTest {
116116
sut.state.test {
117117
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
118118
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
119-
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
119+
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
120120
sut.reset()
121121
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
122122
}

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CurrentPushProviderTest(
4444
} else {
4545
delegate.updateState(
4646
description = stringProvider.getString(R.string.troubleshoot_notifications_test_current_push_provider_failure),
47-
status = NotificationTroubleshootTestState.Status.Failure(false)
47+
status = NotificationTroubleshootTestState.Status.Failure()
4848
)
4949
}
5050
}

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class NotificationTest(
5454
} else {
5555
delegate.updateState(
5656
description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_permission_failure),
57-
status = NotificationTroubleshootTestState.Status.Failure(false)
57+
status = NotificationTroubleshootTestState.Status.Failure()
5858
)
5959
}
6060
}
@@ -81,7 +81,7 @@ class NotificationTest(
8181
notificationDisplayer.dismissDiagnosticNotification()
8282
delegate.updateState(
8383
description = stringProvider.getString(R.string.troubleshoot_notifications_test_display_notification_failure),
84-
status = NotificationTroubleshootTestState.Status.Failure(false)
84+
status = NotificationTroubleshootTestState.Status.Failure()
8585
)
8686
}
8787
)

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,23 @@ class PushLoopbackTest(
5757
val hasQuickFix = pushService.getCurrentPushProvider()?.canRotateToken() == true
5858
delegate.updateState(
5959
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_1),
60-
status = NotificationTroubleshootTestState.Status.Failure(hasQuickFix)
60+
status = NotificationTroubleshootTestState.Status.Failure(hasQuickFix = hasQuickFix)
6161
)
6262
job.cancel()
6363
return
6464
} catch (e: Exception) {
6565
Timber.e(e, "Failed to test push")
6666
delegate.updateState(
6767
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_2, e.message),
68-
status = NotificationTroubleshootTestState.Status.Failure(false)
68+
status = NotificationTroubleshootTestState.Status.Failure()
6969
)
7070
job.cancel()
7171
return
7272
}
7373
if (!testPushResult) {
7474
delegate.updateState(
7575
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_3),
76-
status = NotificationTroubleshootTestState.Status.Failure(false)
76+
status = NotificationTroubleshootTestState.Status.Failure()
7777
)
7878
job.cancel()
7979
return
@@ -94,7 +94,7 @@ class PushLoopbackTest(
9494
job.cancel()
9595
delegate.updateState(
9696
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_4),
97-
status = NotificationTroubleshootTestState.Status.Failure(false)
97+
status = NotificationTroubleshootTestState.Status.Failure()
9898
)
9999
}
100100
)

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class PushProvidersTest(
4848
} else {
4949
delegate.updateState(
5050
description = stringProvider.getString(R.string.troubleshoot_notifications_test_detect_push_provider_failure),
51-
status = NotificationTroubleshootTestState.Status.Failure(false)
51+
status = NotificationTroubleshootTestState.Status.Failure()
5252
)
5353
}
5454
}

libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class CurrentPushProviderTestTest {
4848
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
4949
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
5050
val lastItem = awaitItem()
51-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
51+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
5252
sut.reset()
5353
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
5454
}

libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class PushLoopbackTestTest {
4040
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
4141
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
4242
val lastItem = awaitItem()
43-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
43+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
4444
}
4545
}
4646

@@ -64,7 +64,7 @@ class PushLoopbackTestTest {
6464
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
6565
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
6666
val lastItem = awaitItem()
67-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
67+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
6868
sut.reset()
6969
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
7070
}
@@ -97,10 +97,10 @@ class PushLoopbackTestTest {
9797
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
9898
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
9999
val lastItem = awaitItem()
100-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
100+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
101101
sut.quickFix(this, FakeNotificationTroubleshootNavigator())
102102
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
103-
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(true))
103+
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true))
104104
rotateTokenLambda.assertions().isCalledOnce()
105105
}
106106
}
@@ -123,7 +123,7 @@ class PushLoopbackTestTest {
123123
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
124124
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
125125
val lastItem = awaitItem()
126-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
126+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
127127
}
128128
}
129129

@@ -147,7 +147,7 @@ class PushLoopbackTestTest {
147147
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
148148
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
149149
val lastItem = awaitItem()
150-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
150+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
151151
assertThat(lastItem.description).contains(A_FAILURE_REASON)
152152
}
153153
}

libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class PushProvidersTestTest {
3030
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
3131
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
3232
val lastItem = awaitItem()
33-
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure(false))
33+
assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Failure())
3434
sut.reset()
3535
assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.Idle(true))
3636
}

libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class FirebaseAvailabilityTest(
5151
} else {
5252
delegate.updateState(
5353
description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_availability_failure),
54-
status = NotificationTroubleshootTestState.Status.Failure(false)
54+
status = NotificationTroubleshootTestState.Status.Failure()
5555
)
5656
}
5757
}

libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class FirebaseTokenTest(
6363
} else {
6464
delegate.updateState(
6565
description = stringProvider.getString(R.string.troubleshoot_notifications_test_firebase_token_failure),
66-
status = NotificationTroubleshootTestState.Status.Failure(true)
66+
status = NotificationTroubleshootTestState.Status.Failure(hasQuickFix = true)
6767
)
6868
}
6969
}

0 commit comments

Comments
 (0)