Add test for filtering

This commit is contained in:
Kovid Goyal
2024-07-28 09:15:18 +05:30
parent 67410c317f
commit 59c175f312
2 changed files with 18 additions and 1 deletions

View File

@@ -69,6 +69,13 @@ class Channel(Channel):
self.responses.append(osc_escape_code)
class NotificationManager(NotificationManager):
@property
def filter_rules(self):
yield from ('title:filterme',)
def do_test(self: 'TestNotifications', tdir: str) -> None:
di = DesktopIntegration(None)
ch = Channel()
@@ -162,6 +169,12 @@ def do_test(self: 'TestNotifications', tdir: str) -> None:
self.ae(di.notifications, [n()])
reset()
# test filtering
h(';title')
h(';filterme please')
self.ae(di.notifications, [n()])
reset()
# test closing interactions with reporting and activation
h('i=c;title')
self.ae(di.notifications, [n()])