File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/renderer/utils/notifications Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11import { mockSingleAccountNotifications } from '../../__mocks__/notifications-mocks' ;
2- import { mockSettings } from '../../__mocks__/state-mocks' ;
2+ import {
3+ mockGitHubEnterpriseServerAccount ,
4+ mockSettings ,
5+ } from '../../__mocks__/state-mocks' ;
36import { mockSingleNotification } from '../api/__mocks__/response-mocks' ;
47import { removeNotificationsForAccount } from './remove' ;
58
@@ -62,4 +65,19 @@ describe('renderer/utils/remove.ts', () => {
6265
6366 expect ( result [ 0 ] . notifications . length ) . toBe ( 1 ) ;
6467 } ) ;
68+
69+ it ( 'should not modify notifications when account UUID does not match' , ( ) => {
70+ const result = removeNotificationsForAccount (
71+ mockGitHubEnterpriseServerAccount , // Different account
72+ { ...mockSettings , delayNotificationState : false } ,
73+ [ mockSingleNotification ] ,
74+ mockSingleAccountNotifications ,
75+ ) ;
76+
77+ // Should return unchanged
78+ expect ( result [ 0 ] . notifications . length ) . toBe ( 1 ) ;
79+ expect ( result [ 0 ] . notifications [ 0 ] ) . toBe (
80+ mockSingleAccountNotifications [ 0 ] . notifications [ 0 ] ,
81+ ) ;
82+ } ) ;
6583} ) ;
You can’t perform that action at this time.
0 commit comments