-
Notifications
You must be signed in to change notification settings - Fork 286
Expand file tree
/
Copy pathnotifications-mocks.ts
More file actions
45 lines (42 loc) · 1.12 KB
/
notifications-mocks.ts
File metadata and controls
45 lines (42 loc) · 1.12 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
40
41
42
43
44
45
import type { AccountNotifications } from '../types';
import type { StateType, Subject, SubjectType } from '../typesGitHub';
import {
mockEnterpriseNotifications,
mockGitHubNotifications,
} from '../utils/api/__mocks__/response-mocks';
import {
mockGitHubCloudAccount,
mockGitHubEnterpriseServerAccount,
} from './state-mocks';
export const mockAccountNotifications: AccountNotifications[] = [
{
account: mockGitHubCloudAccount,
notifications: mockGitHubNotifications,
error: null,
},
{
account: mockGitHubEnterpriseServerAccount,
notifications: mockEnterpriseNotifications,
error: null,
},
];
export const mockSingleAccountNotifications: AccountNotifications[] = [
{
account: mockGitHubCloudAccount,
notifications: [mockGitHubNotifications[0]],
error: null,
},
];
export function createSubjectMock(mocks: {
title?: string;
type?: SubjectType;
state?: StateType;
}): Subject {
return {
title: mocks.title ?? 'Mock Subject',
type: mocks.type ?? ('Unknown' as SubjectType),
state: mocks.state ?? ('Unknown' as StateType),
url: null,
latest_comment_url: null,
};
}