-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathLinkedIssuesPill.test.tsx
More file actions
28 lines (21 loc) · 961 Bytes
/
LinkedIssuesPill.test.tsx
File metadata and controls
28 lines (21 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { renderWithAppContext } from '../../__helpers__/test-utils';
import { mockGitifyNotification } from '../../__mocks__/notifications-mocks';
import { LinkedIssuesPill } from './LinkedIssuesPill';
describe('renderer/components/metrics/LinkedIssuesPill.tsx', () => {
it('renders when linked to one issue/pr', () => {
const mockNotification = { ...mockGitifyNotification };
mockNotification.subject.linkedIssues = ['#1'];
const tree = renderWithAppContext(
<LinkedIssuesPill linkedIssues={mockNotification.subject.linkedIssues} />,
);
expect(tree).toMatchSnapshot();
});
it('renders when linked to multiple issues/prs', () => {
const mockNotification = { ...mockGitifyNotification };
mockNotification.subject.linkedIssues = ['#1', '#2'];
const tree = renderWithAppContext(
<LinkedIssuesPill linkedIssues={mockNotification.subject.linkedIssues} />,
);
expect(tree).toMatchSnapshot();
});
});