Filter group summary cancellation logs
This commit is contained in:
@@ -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,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user