Avoid duplicate BigText notification content
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user