File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,15 @@ describe('./utils/github-api.ts', () => {
19
19
} ) ;
20
20
21
21
it ( 'should get the notification type icon' , ( ) => {
22
+ expect ( getNotificationTypeIcon ( 'CheckSuite' ) ) . toBe ( 'sync' ) ;
23
+ expect ( getNotificationTypeIcon ( 'Commit' ) ) . toBe ( 'git-commit' ) ;
24
+ expect ( getNotificationTypeIcon ( 'Discussion' ) ) . toBe ( 'comment-discussion' ) ;
22
25
expect ( getNotificationTypeIcon ( 'Issue' ) ) . toBe ( 'issue-opened' ) ;
23
26
expect ( getNotificationTypeIcon ( 'PullRequest' ) ) . toBe ( 'git-pull-request' ) ;
24
- expect ( getNotificationTypeIcon ( 'Commit' ) ) . toBe ( 'git-commit' ) ;
25
27
expect ( getNotificationTypeIcon ( 'Release' ) ) . toBe ( 'tag' ) ;
26
28
expect ( getNotificationTypeIcon ( 'RepositoryVulnerabilityAlert' ) ) . toBe (
27
29
'alert'
28
30
) ;
29
- expect ( getNotificationTypeIcon ( 'CheckSuite' ) ) . toBe ( 'sync' ) ;
30
31
expect ( getNotificationTypeIcon ( 'Unknown' as SubjectType ) ) . toBe ( 'question' ) ;
31
32
} ) ;
32
33
} ) ;
Original file line number Diff line number Diff line change @@ -53,18 +53,20 @@ export function formatReason(
53
53
54
54
export function getNotificationTypeIcon ( type : SubjectType ) : string {
55
55
switch ( type ) {
56
+ case 'CheckSuite' :
57
+ return 'sync' ;
58
+ case 'Commit' :
59
+ return 'git-commit' ;
60
+ case 'Discussion' :
61
+ return 'comment-discussion' ;
56
62
case 'Issue' :
57
63
return 'issue-opened' ;
58
64
case 'PullRequest' :
59
65
return 'git-pull-request' ;
60
- case 'Commit' :
61
- return 'git-commit' ;
62
66
case 'Release' :
63
67
return 'tag' ;
64
68
case 'RepositoryVulnerabilityAlert' :
65
69
return 'alert' ;
66
- case 'CheckSuite' :
67
- return 'sync' ;
68
70
default :
69
71
return 'question' ;
70
72
}
Original file line number Diff line number Diff line change @@ -13,11 +13,12 @@ export type Reason =
13
13
| 'ci_activity' ;
14
14
15
15
export type SubjectType =
16
+ | 'CheckSuite'
17
+ | 'Commit'
18
+ | 'Discussion'
16
19
| 'Issue'
17
20
| 'PullRequest'
18
- | 'Commit'
19
21
| 'Release'
20
- | 'CheckSuite'
21
22
| 'RepositoryVulnerabilityAlert' ;
22
23
23
24
export interface Notification {
You can’t perform that action at this time.
0 commit comments