-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathCommentsPill.test.tsx
More file actions
39 lines (29 loc) · 1.2 KB
/
CommentsPill.test.tsx
File metadata and controls
39 lines (29 loc) · 1.2 KB
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
29
30
31
32
33
34
35
36
37
38
39
import { renderWithAppContext } from '../../__helpers__/test-utils';
import { mockGitifyNotification } from '../../__mocks__/notifications-mocks';
import { CommentsPill } from './CommentsPill';
describe('renderer/components/metrics/CommentsPill.tsx', () => {
it('renders with no comments (null)', () => {
const mockNotification = { ...mockGitifyNotification };
mockNotification.subject.commentCount = null;
const tree = renderWithAppContext(
<CommentsPill commentCount={mockNotification.subject.commentCount} />,
);
expect(tree).toMatchSnapshot();
});
it('renders with 1 comment', () => {
const mockNotification = { ...mockGitifyNotification };
mockNotification.subject.commentCount = 1;
const tree = renderWithAppContext(
<CommentsPill commentCount={mockNotification.subject.commentCount} />,
);
expect(tree).toMatchSnapshot();
});
it('renders with multiple comments', () => {
const mockNotification = { ...mockGitifyNotification };
mockNotification.subject.commentCount = 2;
const tree = renderWithAppContext(
<CommentsPill commentCount={mockNotification.subject.commentCount} />,
);
expect(tree).toMatchSnapshot();
});
});