Skip to content

Commit 45d9f54

Browse files
committed
fix: notification read state for delayNotificationState
Signed-off-by: Adam Setch <[email protected]>
1 parent c4d745e commit 45d9f54

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

src/renderer/hooks/useNotifications.test.ts

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -369,31 +369,6 @@ describe('renderer/hooks/useNotifications.ts', () => {
369369
expect(result.current.status).toBe('success');
370370
});
371371

372-
expect(result.current.notifications.length).toBe(0);
373-
expect(mockSingleNotification.unread).toBeTruthy();
374-
});
375-
376-
it('should mark notifications as read with success - delayNotificationState', async () => {
377-
nock('https://api.github.com/')
378-
.patch(`/notifications/threads/${id}`)
379-
.reply(200);
380-
381-
const { result } = renderHook(() => useNotifications());
382-
383-
act(() => {
384-
result.current.markNotificationsAsRead(
385-
{
386-
...mockState,
387-
settings: { ...mockState.settings, delayNotificationState: true },
388-
},
389-
[mockSingleNotification],
390-
);
391-
});
392-
393-
await waitFor(() => {
394-
expect(result.current.status).toBe('success');
395-
});
396-
397372
expect(result.current.notifications.length).toBe(0);
398373
expect(mockSingleNotification.unread).toBeFalsy();
399374
});
@@ -438,31 +413,6 @@ describe('renderer/hooks/useNotifications.ts', () => {
438413
expect(result.current.status).toBe('success');
439414
});
440415

441-
expect(result.current.notifications.length).toBe(0);
442-
expect(mockSingleNotification.unread).toBeTruthy();
443-
});
444-
445-
it('should mark notifications as done with success - delayNotificationState', async () => {
446-
nock('https://api.github.com/')
447-
.delete(`/notifications/threads/${id}`)
448-
.reply(200);
449-
450-
const { result } = renderHook(() => useNotifications());
451-
452-
act(() => {
453-
result.current.markNotificationsAsDone(
454-
{
455-
...mockState,
456-
settings: { ...mockState.settings, delayNotificationState: true },
457-
},
458-
[mockSingleNotification],
459-
);
460-
});
461-
462-
await waitFor(() => {
463-
expect(result.current.status).toBe('success');
464-
});
465-
466416
expect(result.current.notifications.length).toBe(0);
467417
expect(mockSingleNotification.unread).toBeFalsy();
468418
});

0 commit comments

Comments
 (0)