From edc6b32fa711aa8577dec7570622268e0f919288 Mon Sep 17 00:00:00 2001 From: evgeny Date: Wed, 28 Oct 2026 14:01:45 +0100 Subject: [PATCH] Cover orphan notification cleanup through language refresh --- .../kotlin/com/utun/chat/data/IncomingCallLifecycleTest.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/chatgui-android/router-tests/src/test/kotlin/com/utun/chat/data/IncomingCallLifecycleTest.kt b/tools/chatgui-android/router-tests/src/test/kotlin/com/utun/chat/data/IncomingCallLifecycleTest.kt index 103bad772..1929cdf56 100644 --- a/tools/chatgui-android/router-tests/src/test/kotlin/com/utun/chat/data/IncomingCallLifecycleTest.kt +++ b/tools/chatgui-android/router-tests/src/test/kotlin/com/utun/chat/data/IncomingCallLifecycleTest.kt @@ -196,10 +196,13 @@ class IncomingCallLifecycleTest { PendingIntent.created.forEach { assertEquals(1, it.cancelCalls) } } - @Test fun languageRefreshWithoutCallOnlyCreatesChannel() { - IncomingCallManager.refreshLanguage() + @Test fun languageRefreshWithoutCallPreparesChannelAndClearsOrphanedNotification() { + notifications.active[IncomingCallManager.NOTIF_ID] = Notification() + repeat(3) { IncomingCallManager.refreshLanguage() } assertEquals(1, notifications.channels.size) assertTrue(notifications.posted.isEmpty()) + assertTrue(notifications.active.isEmpty()) + assertEquals(listOf(IncomingCallManager.NOTIF_ID), notifications.cancellations) assertTrue(power.locks.isEmpty()) assertTrue(RingtoneManager.created.isEmpty()) }