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
10 changes: 3 additions & 7 deletions src/components/Sidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('components/Sidebar.tsx', () => {
expect(tree).toMatchSnapshot();
});

it('should open the gitify repository', () => {
it('should navigate home when clicking the gitify logo', () => {
render(
<AppContext.Provider
value={{
Expand All @@ -76,12 +76,8 @@ describe('components/Sidebar.tsx', () => {
</AppContext.Provider>,
);

fireEvent.click(screen.getByTestId('gitify-logo'));

expect(openExternalLinkMock).toHaveBeenCalledTimes(1);
expect(openExternalLinkMock).toHaveBeenCalledWith(
'https://github.com/gitify-app/gitify',
);
fireEvent.click(screen.getByTitle('Home'));
expect(mockNavigate).toHaveBeenNthCalledWith(1, '/', { replace: true });
});

describe('quick links', () => {
Expand Down
6 changes: 2 additions & 4 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
openGitHubIssues,
openGitHubNotifications,
openGitHubPulls,
openGitifyRepository,
} from '../utils/links';
import { getNotificationCount } from '../utils/notifications';
import { SidebarButton } from './buttons/SidebarButton';
Expand Down Expand Up @@ -77,9 +76,8 @@ export const Sidebar: FC = () => {
<button
type="button"
className="mx-auto my-3 cursor-pointer outline-none"
title="Open Gitify on GitHub"
onClick={() => openGitifyRepository()}
data-testid="gitify-logo"
title="Home"
onClick={() => navigate('/', { replace: true })}
>
<LogoIcon size={Size.SMALL} aria-label="Open Gitify" />
</button>
Expand Down
12 changes: 4 additions & 8 deletions src/components/__snapshots__/Sidebar.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions src/utils/links.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
openGitHubParticipatingDocs,
openGitHubPulls,
openGitifyReleaseNotes,
openGitifyRepository,
openHost,
openNotification,
openRepository,
Expand All @@ -31,13 +30,6 @@ describe('utils/links.ts', () => {
jest.clearAllMocks();
});

it('openGitifyRepository', () => {
openGitifyRepository();
expect(openExternalLinkMock).toHaveBeenCalledWith(
'https://github.com/gitify-app/gitify',
);
});

it('openGitifyReleaseNotes', () => {
openGitifyReleaseNotes('v1.0.0');
expect(openExternalLinkMock).toHaveBeenCalledWith(
Expand Down
4 changes: 0 additions & 4 deletions src/utils/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { openExternalLink } from './comms';
import { Constants } from './constants';
import { generateGitHubWebUrl } from './helpers';

export function openGitifyRepository() {
openExternalLink(`https://github.com/${Constants.REPO_SLUG}` as Link);
}

export function openGitifyReleaseNotes(version: string) {
openExternalLink(
`https://github.com/${Constants.REPO_SLUG}/releases/tag/${version}` as Link,
Expand Down