From 9d8f670323754259d584d17a4f011d385df0373c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 13 Aug 2025 10:35:46 +0200 Subject: [PATCH] Fix tests. --- .../developer/DeveloperSettingsViewTest.kt | 17 +++++++++++++++++ .../NotificationSettingsViewTest.kt | 18 ------------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsViewTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsViewTest.kt index 5d0030af8e..37e28ca88f 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsViewTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsViewTest.kt @@ -52,6 +52,21 @@ class DeveloperSettingsViewTest { } } + @Config(qualifiers = "h1500dp") + @Test + fun `clicking on push history notification invokes the expected callback`() { + val eventsRecorder = EventsRecorder(expectEvents = false) + ensureCalledOnce { + rule.setDeveloperSettingsView( + state = aDeveloperSettingsState( + eventSink = eventsRecorder + ), + onPushHistoryClick = it + ) + rule.clickOn(R.string.troubleshoot_notifications_entry_point_push_history_title) + } + } + @Config(qualifiers = "h1500dp") @Test fun `clicking on element call url open the dialogs and submit emits the expected event`() { @@ -114,12 +129,14 @@ class DeveloperSettingsViewTest { private fun AndroidComposeTestRule.setDeveloperSettingsView( state: DeveloperSettingsState, onOpenShowkase: () -> Unit = EnsureNeverCalled(), + onPushHistoryClick: () -> Unit = EnsureNeverCalled(), onBackClick: () -> Unit = EnsureNeverCalled() ) { setContent { DeveloperSettingsView( state = state, onOpenShowkase = onOpenShowkase, + onPushHistoryClick = onPushHistoryClick, onBackClick = onBackClick, ) } diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsViewTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsViewTest.kt index 3b2a2663a5..2aa485a192 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsViewTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsViewTest.kt @@ -66,22 +66,6 @@ class NotificationSettingsViewTest { eventsRecorder.assertSingle(NotificationSettingsEvents.RefreshSystemNotificationsEnabled) } - @Config(qualifiers = "h1024dp") - @Test - fun `clicking on push history notification invokes the expected callback`() { - val eventsRecorder = EventsRecorder() - ensureCalledOnce { - rule.setNotificationSettingsView( - state = aValidNotificationSettingsState( - eventSink = eventsRecorder - ), - onPushHistoryClick = it - ) - rule.clickOn(R.string.troubleshoot_notifications_entry_point_push_history_title) - } - eventsRecorder.assertSingle(NotificationSettingsEvents.RefreshSystemNotificationsEnabled) - } - @Config(qualifiers = "h1024dp") @Test fun `clicking on group chats invokes the expected callback`() { @@ -300,7 +284,6 @@ private fun AndroidComposeTestRule.setNotif state: NotificationSettingsState, onOpenEditDefault: (isOneToOne: Boolean) -> Unit = EnsureNeverCalledWithParam(), onTroubleshootNotificationsClick: () -> Unit = EnsureNeverCalled(), - onPushHistoryClick: () -> Unit = EnsureNeverCalled(), onBackClick: () -> Unit = EnsureNeverCalled(), ) { setContent { @@ -308,7 +291,6 @@ private fun AndroidComposeTestRule.setNotif state = state, onOpenEditDefault = onOpenEditDefault, onTroubleshootNotificationsClick = onTroubleshootNotificationsClick, - onPushHistoryClick = onPushHistoryClick, onBackClick = onBackClick, ) }