-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathaccount-mocks.ts
More file actions
65 lines (57 loc) · 1.58 KB
/
account-mocks.ts
File metadata and controls
65 lines (57 loc) · 1.58 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { Constants } from '../constants';
import type {
Account,
AccountNotifications,
GitifyError,
Hostname,
Token,
} from '../types';
import { mockGitifyUser } from './user-mocks';
export const mockGitHubAppAccount: Account = {
platform: 'GitHub Cloud',
method: 'GitHub App',
token: 'token-987654321' as Token,
hostname: Constants.GITHUB_HOSTNAME,
user: mockGitifyUser,
hasRequiredScopes: true,
};
export const mockPersonalAccessTokenAccount: Account = {
platform: 'GitHub Cloud',
method: 'Personal Access Token',
token: 'token-123-456' as Token,
hostname: Constants.GITHUB_HOSTNAME,
user: mockGitifyUser,
hasRequiredScopes: true,
};
export const mockOAuthAccount: Account = {
platform: 'GitHub Enterprise Server',
method: 'OAuth App',
token: 'token-1234568790' as Token,
hostname: 'github.gitify.io' as Hostname,
user: mockGitifyUser,
hasRequiredScopes: true,
};
export const mockGitHubCloudAccount: Account = {
platform: 'GitHub Cloud',
method: 'Personal Access Token',
token: 'token-123-456' as Token,
hostname: Constants.GITHUB_HOSTNAME,
user: mockGitifyUser,
version: 'latest',
hasRequiredScopes: true,
};
export const mockGitHubEnterpriseServerAccount: Account = {
platform: 'GitHub Enterprise Server',
method: 'Personal Access Token',
token: 'token-1234568790' as Token,
hostname: 'github.gitify.io' as Hostname,
user: mockGitifyUser,
hasRequiredScopes: true,
};
export function mockAccountWithError(error: GitifyError): AccountNotifications {
return {
account: mockGitHubCloudAccount,
notifications: [],
error,
};
}