Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ const LIGHT_GRADIENT_END = '#FFFFFF';
const DARK_GRADIENT_START = '#22283B';
const DARK_GRADIENT_END = '#555B6E';

export const Logo = ({ isDark, onClick, className = '' }: IProps) => (
export const Logo = ({ isDark, onClick, className = '', ...props }: IProps) => (
<svg
className={className}
onClick={() => onClick && onClick()}
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
viewBox="0 0 500 500"
role="logo"
{...props}
>
<defs>
<linearGradient
Expand Down
30 changes: 29 additions & 1 deletion src/components/Sidebar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fireEvent, render } from '@testing-library/react';
import { fireEvent, render, screen } from '@testing-library/react';
import { createMemoryHistory } from 'history';
import * as React from 'react';
import { Router } from 'react-router';
Expand Down Expand Up @@ -102,6 +102,34 @@ describe('components/Sidebar.tsx', () => {
);
});

it('should quit the app', () => {
const { getByLabelText } = render(
<AppContext.Provider value={{ isLoggedIn: false, notifications: [] }}>
<MemoryRouter>
<Sidebar />
</MemoryRouter>
</AppContext.Provider>
);
fireEvent.click(getByLabelText('Quit App'));
expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
expect(ipcRenderer.send).toHaveBeenCalledWith('app-quit');
});

it('should open the gitify repository', () => {
render(
<AppContext.Provider value={{ isLoggedIn: false, notifications: [] }}>
<MemoryRouter>
<Sidebar />
</MemoryRouter>
</AppContext.Provider>
);
fireEvent.click(screen.getByTestId('gitify-logo'));
expect(shell.openExternal).toHaveBeenCalledTimes(1);
expect(shell.openExternal).toHaveBeenCalledWith(
'https://github.com/gitify-app/gitify'
);
});

describe('should render the notifications icon', () => {
it('when there are 0 notifications', () => {
const { getByLabelText } = render(
Expand Down
1 change: 1 addition & 0 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const Sidebar: React.FC = () => {
<div className="flex flex-col flex-1 items-center py-4">
<Logo
className="w-5 my-3 mx-auto cursor-pointer"
data-testid="gitify-logo"
onClick={onOpenBrowser}
/>

Expand Down
2 changes: 2 additions & 0 deletions src/components/__snapshots__/Sidebar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in)
>
<svg
className="w-5 my-3 mx-auto cursor-pointer"
data-testid="gitify-logo"
onClick={[Function]}
role="logo"
viewBox="0 0 500 500"
Expand Down Expand Up @@ -127,6 +128,7 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out)
>
<svg
className="w-5 my-3 mx-auto cursor-pointer"
data-testid="gitify-logo"
onClick={[Function]}
role="logo"
viewBox="0 0 500 500"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Constants = {
clientSecret: process.env.OAUTH_CLIENT_SECRET,
},

REPO_SLUG: 'manosim/gitify',
REPO_SLUG: 'gitify-app/gitify',

// Storage
STORAGE_KEY: 'gitify-storage',
Expand Down