diff --git a/src/context/App.test.tsx b/src/context/App.test.tsx
index 0409a4e79..5ba772d4c 100644
--- a/src/context/App.test.tsx
+++ b/src/context/App.test.tsx
@@ -48,6 +48,7 @@ describe('context/App.tsx', () => {
const markNotificationDoneMock = jest.fn();
const unsubscribeNotificationMock = jest.fn();
const markRepoNotificationsMock = jest.fn();
+ const markRepoNotificationsDoneMock = jest.fn();
beforeEach(() => {
(useNotifications as jest.Mock).mockReturnValue({
@@ -56,6 +57,7 @@ describe('context/App.tsx', () => {
markNotificationDone: markNotificationDoneMock,
unsubscribeNotification: unsubscribeNotificationMock,
markRepoNotifications: markRepoNotificationsMock,
+ markRepoNotificationsDone: markRepoNotificationsDoneMock,
});
});
@@ -234,6 +236,40 @@ describe('context/App.tsx', () => {
);
});
+ it('should call markRepoNotificationsDone', async () => {
+ const TestComponent = () => {
+ const { markRepoNotificationsDone } = useContext(AppContext);
+
+ return (
+
+ );
+ };
+
+ const { getByText } = customRender();
+
+ markRepoNotificationsDoneMock.mockReset();
+
+ fireEvent.click(getByText('Test Case'));
+
+ expect(markRepoNotificationsDoneMock).toHaveBeenCalledTimes(1);
+ expect(markRepoNotificationsDoneMock).toHaveBeenCalledWith(
+ { enterpriseAccounts: [], token: null, user: null },
+ mockSettings,
+ 'gitify-app/notifications-test',
+ 'github.com',
+ );
+ });
+
it('should call validateToken', async () => {
apiRequestAuthMock.mockResolvedValueOnce(null);