Avoid duplicate BigText notification content

This commit is contained in:
ajp_anton
2026-07-27 22:32:28 +00:00
parent 6a41b922e3
commit ebb05acc02
2 changed files with 59 additions and 7 deletions
@@ -0,0 +1,32 @@
package se.ajpanton.notificationlog.capture
import org.junit.Assert.assertEquals
import org.junit.Test
class NotificationContentsTest {
@Test fun `expanded text replaces the alternate collapsed rendering`() {
val contents = NotificationContents.genericContents(
title = "Sender",
text = "Subject • Email body",
bigText = "Subject\nEmail body",
subText = "account@example.com",
summaryText = null,
textLines = emptyList(),
)
assertEquals("Sender\nSubject\nEmail body\naccount@example.com", contents)
}
@Test fun `collapsed text remains the fallback without expanded text`() {
val contents = NotificationContents.genericContents(
title = "Sender",
text = "Subject • Email body",
bigText = null,
subText = "account@example.com",
summaryText = null,
textLines = emptyList(),
)
assertEquals("Sender\nSubject • Email body\naccount@example.com", contents)
}
}