Cover orphan notification cleanup through language refresh

This commit is contained in:
evgeny committed 2026-10-28 14:43:27 +01:00
1 parent d67991d08a
commit edc6b32fa7
1 file changed
+5 -2
@@ -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())
}