@@ -63,6 +63,34 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
6363 ] ;
6464
6565 describe ( 'filterBaseNotifications' , ( ) => {
66+ it ( 'should show all notifications when showReadNotifications is enabled' , ( ) => {
67+ const notifications = [
68+ { ...mockNotifications [ 0 ] , unread : true } ,
69+ { ...mockNotifications [ 1 ] , unread : false } ,
70+ ] ;
71+ const result = filterBaseNotifications ( notifications , {
72+ ...mockSettings ,
73+ showReadNotifications : true ,
74+ } ) ;
75+
76+ expect ( result . length ) . toBe ( 2 ) ;
77+ expect ( result ) . toEqual ( notifications ) ;
78+ } ) ;
79+
80+ it ( 'should filter out read notifications when showReadNotifications is disabled' , ( ) => {
81+ const notifications = [
82+ { ...mockNotifications [ 0 ] , unread : true } ,
83+ { ...mockNotifications [ 1 ] , unread : false } ,
84+ ] ;
85+ const result = filterBaseNotifications ( notifications , {
86+ ...mockSettings ,
87+ showReadNotifications : false ,
88+ } ) ;
89+
90+ expect ( result . length ) . toBe ( 1 ) ;
91+ expect ( result [ 0 ] . unread ) . toBe ( true ) ;
92+ } ) ;
93+
6694 it ( 'should filter notifications by subject type when provided' , async ( ) => {
6795 mockNotifications [ 0 ] . subject . type = 'Issue' ;
6896 mockNotifications [ 1 ] . subject . type = 'PullRequest' ;
0 commit comments