Skip to content

Commit 34927a7

Browse files
committed
test coverage
Signed-off-by: Adam Setch <[email protected]>
1 parent 1cc6ab1 commit 34927a7

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/renderer/utils/notifications/remove.test.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { mockSingleAccountNotifications } from '../../__mocks__/notifications-mocks';
2-
import { mockSettings } from '../../__mocks__/state-mocks';
2+
import {
3+
mockGitHubEnterpriseServerAccount,
4+
mockSettings,
5+
} from '../../__mocks__/state-mocks';
36
import { mockSingleNotification } from '../api/__mocks__/response-mocks';
47
import { 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
});

0 commit comments

Comments
 (0)