Filter group summary cancellation logs

This commit is contained in:
ajp_anton
2026-07-27 22:08:25 +00:00
parent 6116c13e00
commit 6a41b922e3
3 changed files with 30 additions and 2 deletions
@@ -3,6 +3,7 @@ package se.ajpanton.notificationlog.capture
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import se.ajpanton.notificationlog.model.NotificationAction
class GroupSummaryPolicyTest {
private fun snapshot(isGroupSummary: Boolean) = NotificationSnapshot(
@@ -23,4 +24,21 @@ class GroupSummaryPolicyTest {
assertFalse(GroupSummaryPolicy.shouldLog(snapshot(isGroupSummary = true), logGroupSummaries = false))
assertTrue(GroupSummaryPolicy.shouldLog(snapshot(isGroupSummary = false), logGroupSummaries = false))
}
@Test fun `group summary cancellation is hidden when group summaries are disabled`() {
assertFalse(
GroupSummaryPolicy.shouldLog(
snapshot(isGroupSummary = false),
NotificationAction.GROUP_SUMMARY_CANCELLED,
logGroupSummaries = false,
),
)
assertTrue(
GroupSummaryPolicy.shouldLog(
snapshot(isGroupSummary = false),
NotificationAction.GROUP_SUMMARY_CANCELLED,
logGroupSummaries = true,
),
)
}
}