diff --git a/src/components/Sidebar.test.tsx b/src/components/Sidebar.test.tsx index 0dfe0ed74..55039aa61 100644 --- a/src/components/Sidebar.test.tsx +++ b/src/components/Sidebar.test.tsx @@ -82,7 +82,27 @@ describe('components/Sidebar.tsx', () => { expect(pushMock).toHaveBeenCalledTimes(1); }); - it('open the gitify repo in browser', () => { + it('opens github in the notifications page', () => { + const { getByLabelText } = render( + + + + + + ); + fireEvent.click(getByLabelText('4 Unread Notifications')); + expect(shell.openExternal).toHaveBeenCalledTimes(1); + expect(shell.openExternal).toHaveBeenCalledWith( + 'https://github.com/notifications' + ); + }); + + it('opens the gitify repo in browser', () => { const { getByLabelText } = render( @@ -92,5 +112,8 @@ describe('components/Sidebar.tsx', () => { ); fireEvent.click(getByLabelText('View project on GitHub')); expect(shell.openExternal).toHaveBeenCalledTimes(1); + expect(shell.openExternal).toHaveBeenCalledWith( + 'https://github.com/manosim/gitify' + ); }); }); diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index d578db499..be3364ff0 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -20,6 +20,10 @@ export const Sidebar: React.FC = () => { shell.openExternal(`https://github.com/${Constants.REPO_SLUG}`); }, []); + const onOpenGitHubNotifications = useCallback(() => { + shell.openExternal(`https://github.com/notifications`); + }, []); + const quitApp = useCallback(() => { ipcRenderer.send('app-quit'); }, []); @@ -43,7 +47,11 @@ export const Sidebar: React.FC = () => { /> {notificationsCount > 0 && ( -
+
{notificationsCount}
diff --git a/src/components/__snapshots__/Sidebar.test.tsx.snap b/src/components/__snapshots__/Sidebar.test.tsx.snap index 37c81c3d2..f83c05b2e 100644 --- a/src/components/__snapshots__/Sidebar.test.tsx.snap +++ b/src/components/__snapshots__/Sidebar.test.tsx.snap @@ -52,7 +52,9 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in)