Skip to content

Commit 51b5d58

Browse files
committed
Fix tests.
1 parent 17c4f38 commit 51b5d58

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsViewTest.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ class DeveloperSettingsViewTest {
5252
}
5353
}
5454

55+
@Config(qualifiers = "h1500dp")
56+
@Test
57+
fun `clicking on push history notification invokes the expected callback`() {
58+
val eventsRecorder = EventsRecorder<DeveloperSettingsEvents>(expectEvents = false)
59+
ensureCalledOnce {
60+
rule.setDeveloperSettingsView(
61+
state = aDeveloperSettingsState(
62+
eventSink = eventsRecorder
63+
),
64+
onPushHistoryClick = it
65+
)
66+
rule.clickOn(R.string.troubleshoot_notifications_entry_point_push_history_title)
67+
}
68+
}
69+
5570
@Config(qualifiers = "h1500dp")
5671
@Test
5772
fun `clicking on element call url open the dialogs and submit emits the expected event`() {
@@ -114,12 +129,14 @@ class DeveloperSettingsViewTest {
114129
private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setDeveloperSettingsView(
115130
state: DeveloperSettingsState,
116131
onOpenShowkase: () -> Unit = EnsureNeverCalled(),
132+
onPushHistoryClick: () -> Unit = EnsureNeverCalled(),
117133
onBackClick: () -> Unit = EnsureNeverCalled()
118134
) {
119135
setContent {
120136
DeveloperSettingsView(
121137
state = state,
122138
onOpenShowkase = onOpenShowkase,
139+
onPushHistoryClick = onPushHistoryClick,
123140
onBackClick = onBackClick,
124141
)
125142
}

features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsViewTest.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,6 @@ class NotificationSettingsViewTest {
6666
eventsRecorder.assertSingle(NotificationSettingsEvents.RefreshSystemNotificationsEnabled)
6767
}
6868

69-
@Config(qualifiers = "h1024dp")
70-
@Test
71-
fun `clicking on push history notification invokes the expected callback`() {
72-
val eventsRecorder = EventsRecorder<NotificationSettingsEvents>()
73-
ensureCalledOnce {
74-
rule.setNotificationSettingsView(
75-
state = aValidNotificationSettingsState(
76-
eventSink = eventsRecorder
77-
),
78-
onPushHistoryClick = it
79-
)
80-
rule.clickOn(R.string.troubleshoot_notifications_entry_point_push_history_title)
81-
}
82-
eventsRecorder.assertSingle(NotificationSettingsEvents.RefreshSystemNotificationsEnabled)
83-
}
84-
8569
@Config(qualifiers = "h1024dp")
8670
@Test
8771
fun `clicking on group chats invokes the expected callback`() {
@@ -300,15 +284,13 @@ private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setNotif
300284
state: NotificationSettingsState,
301285
onOpenEditDefault: (isOneToOne: Boolean) -> Unit = EnsureNeverCalledWithParam(),
302286
onTroubleshootNotificationsClick: () -> Unit = EnsureNeverCalled(),
303-
onPushHistoryClick: () -> Unit = EnsureNeverCalled(),
304287
onBackClick: () -> Unit = EnsureNeverCalled(),
305288
) {
306289
setContent {
307290
NotificationSettingsView(
308291
state = state,
309292
onOpenEditDefault = onOpenEditDefault,
310293
onTroubleshootNotificationsClick = onTroubleshootNotificationsClick,
311-
onPushHistoryClick = onPushHistoryClick,
312294
onBackClick = onBackClick,
313295
)
314296
}

0 commit comments

Comments
 (0)