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', () => {
1919 } ) ;
2020
2121 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' ) ;
2225 expect ( getNotificationTypeIcon ( 'Issue' ) ) . toBe ( 'issue-opened' ) ;
2326 expect ( getNotificationTypeIcon ( 'PullRequest' ) ) . toBe ( 'git-pull-request' ) ;
24- expect ( getNotificationTypeIcon ( 'Commit' ) ) . toBe ( 'git-commit' ) ;
2527 expect ( getNotificationTypeIcon ( 'Release' ) ) . toBe ( 'tag' ) ;
2628 expect ( getNotificationTypeIcon ( 'RepositoryVulnerabilityAlert' ) ) . toBe (
2729 'alert'
2830 ) ;
29- expect ( getNotificationTypeIcon ( 'CheckSuite' ) ) . toBe ( 'sync' ) ;
3031 expect ( getNotificationTypeIcon ( 'Unknown' as SubjectType ) ) . toBe ( 'question' ) ;
3132 } ) ;
3233} ) ;
Original file line number Diff line number Diff line change @@ -53,18 +53,20 @@ export function formatReason(
5353
5454export function getNotificationTypeIcon ( type : SubjectType ) : string {
5555 switch ( type ) {
56+ case 'CheckSuite' :
57+ return 'sync' ;
58+ case 'Commit' :
59+ return 'git-commit' ;
60+ case 'Discussion' :
61+ return 'comment-discussion' ;
5662 case 'Issue' :
5763 return 'issue-opened' ;
5864 case 'PullRequest' :
5965 return 'git-pull-request' ;
60- case 'Commit' :
61- return 'git-commit' ;
6266 case 'Release' :
6367 return 'tag' ;
6468 case 'RepositoryVulnerabilityAlert' :
6569 return 'alert' ;
66- case 'CheckSuite' :
67- return 'sync' ;
6870 default :
6971 return 'question' ;
7072 }
Original file line number Diff line number Diff line change @@ -13,11 +13,12 @@ export type Reason =
1313 | 'ci_activity' ;
1414
1515export type SubjectType =
16+ | 'CheckSuite'
17+ | 'Commit'
18+ | 'Discussion'
1619 | 'Issue'
1720 | 'PullRequest'
18- | 'Commit'
1921 | 'Release'
20- | 'CheckSuite'
2122 | 'RepositoryVulnerabilityAlert' ;
2223
2324export interface Notification {
You can’t perform that action at this time.
0 commit comments