@@ -17,207 +17,12 @@ import type {
1717import {
1818 getAuthMethodIcon ,
1919 getDefaultUserIcon ,
20- getNotificationTypeIcon ,
2120 getNotificationTypeIconColor ,
2221 getPlatformIcon ,
2322 getPullRequestReviewIcon ,
2423} from './icons' ;
2524
2625describe ( 'renderer/utils/icons.ts' , ( ) => {
27- describe ( 'getNotificationTypeIcon - should get the notification type icon' , ( ) => {
28- expect (
29- getNotificationTypeIcon (
30- createSubjectMock ( { type : 'CheckSuite' , state : null } ) ,
31- ) . displayName ,
32- ) . toBe ( 'RocketIcon' ) ;
33-
34- expect (
35- getNotificationTypeIcon (
36- createSubjectMock ( {
37- type : 'CheckSuite' ,
38- state : 'cancelled' ,
39- } ) ,
40- ) . displayName ,
41- ) . toBe ( 'StopIcon' ) ;
42-
43- expect (
44- getNotificationTypeIcon (
45- createSubjectMock ( {
46- type : 'CheckSuite' ,
47- state : 'failure' ,
48- } ) ,
49- ) . displayName ,
50- ) . toBe ( 'XIcon' ) ;
51-
52- expect (
53- getNotificationTypeIcon (
54- createSubjectMock ( {
55- type : 'CheckSuite' ,
56- state : 'skipped' ,
57- } ) ,
58- ) . displayName ,
59- ) . toBe ( 'SkipIcon' ) ;
60-
61- expect (
62- getNotificationTypeIcon (
63- createSubjectMock ( {
64- type : 'CheckSuite' ,
65- state : 'success' ,
66- } ) ,
67- ) . displayName ,
68- ) . toBe ( 'CheckIcon' ) ;
69-
70- expect (
71- getNotificationTypeIcon ( createSubjectMock ( { type : 'Commit' } ) )
72- . displayName ,
73- ) . toBe ( 'GitCommitIcon' ) ;
74-
75- expect (
76- getNotificationTypeIcon ( createSubjectMock ( { type : 'Discussion' } ) )
77- . displayName ,
78- ) . toBe ( 'CommentDiscussionIcon' ) ;
79-
80- expect (
81- getNotificationTypeIcon (
82- createSubjectMock ( { type : 'Discussion' , state : 'DUPLICATE' } ) ,
83- ) . displayName ,
84- ) . toBe ( 'DiscussionDuplicateIcon' ) ;
85-
86- expect (
87- getNotificationTypeIcon (
88- createSubjectMock ( { type : 'Discussion' , state : 'OUTDATED' } ) ,
89- ) . displayName ,
90- ) . toBe ( 'DiscussionOutdatedIcon' ) ;
91-
92- expect (
93- getNotificationTypeIcon (
94- createSubjectMock ( { type : 'Discussion' , state : 'RESOLVED' } ) ,
95- ) . displayName ,
96- ) . toBe ( 'DiscussionClosedIcon' ) ;
97-
98- expect (
99- getNotificationTypeIcon ( createSubjectMock ( { type : 'Issue' } ) ) . displayName ,
100- ) . toBe ( 'IssueOpenedIcon' ) ;
101-
102- expect (
103- getNotificationTypeIcon (
104- createSubjectMock ( { type : 'Issue' , state : 'draft' } ) ,
105- ) . displayName ,
106- ) . toBe ( 'IssueDraftIcon' ) ;
107-
108- expect (
109- getNotificationTypeIcon (
110- createSubjectMock ( {
111- type : 'Issue' ,
112- state : 'closed' ,
113- } ) ,
114- ) . displayName ,
115- ) . toBe ( 'IssueClosedIcon' ) ;
116-
117- expect (
118- getNotificationTypeIcon (
119- createSubjectMock ( {
120- type : 'Issue' ,
121- state : 'completed' ,
122- } ) ,
123- ) . displayName ,
124- ) . toBe ( 'IssueClosedIcon' ) ;
125-
126- expect (
127- getNotificationTypeIcon (
128- createSubjectMock ( {
129- type : 'Issue' ,
130- state : 'not_planned' ,
131- } ) ,
132- ) . displayName ,
133- ) . toBe ( 'SkipIcon' ) ;
134-
135- expect (
136- getNotificationTypeIcon (
137- createSubjectMock ( {
138- type : 'Issue' ,
139- state : 'reopened' ,
140- } ) ,
141- ) . displayName ,
142- ) . toBe ( 'IssueReopenedIcon' ) ;
143-
144- expect (
145- getNotificationTypeIcon ( createSubjectMock ( { type : 'PullRequest' } ) )
146- . displayName ,
147- ) . toBe ( 'GitPullRequestIcon' ) ;
148-
149- expect (
150- getNotificationTypeIcon (
151- createSubjectMock ( {
152- type : 'PullRequest' ,
153- state : 'draft' ,
154- } ) ,
155- ) . displayName ,
156- ) . toBe ( 'GitPullRequestDraftIcon' ) ;
157-
158- expect (
159- getNotificationTypeIcon (
160- createSubjectMock ( {
161- type : 'PullRequest' ,
162- state : 'closed' ,
163- } ) ,
164- ) . displayName ,
165- ) . toBe ( 'GitPullRequestClosedIcon' ) ;
166-
167- expect (
168- getNotificationTypeIcon (
169- createSubjectMock ( {
170- type : 'PullRequest' ,
171- state : 'merged' ,
172- } ) ,
173- ) . displayName ,
174- ) . toBe ( 'GitMergeIcon' ) ;
175-
176- expect (
177- getNotificationTypeIcon (
178- createSubjectMock ( {
179- type : 'Release' ,
180- } ) ,
181- ) . displayName ,
182- ) . toBe ( 'TagIcon' ) ;
183-
184- expect (
185- getNotificationTypeIcon (
186- createSubjectMock ( {
187- type : 'RepositoryDependabotAlertsThread' ,
188- } ) ,
189- ) . displayName ,
190- ) . toBe ( 'AlertIcon' ) ;
191-
192- expect (
193- getNotificationTypeIcon (
194- createSubjectMock ( {
195- type : 'RepositoryInvitation' ,
196- } ) ,
197- ) . displayName ,
198- ) . toBe ( 'MailIcon' ) ;
199-
200- expect (
201- getNotificationTypeIcon (
202- createSubjectMock ( {
203- type : 'RepositoryVulnerabilityAlert' ,
204- } ) ,
205- ) . displayName ,
206- ) . toBe ( 'AlertIcon' ) ;
207-
208- expect (
209- getNotificationTypeIcon (
210- createSubjectMock ( {
211- type : 'WorkflowRun' ,
212- } ) ,
213- ) . displayName ,
214- ) . toBe ( 'RocketIcon' ) ;
215-
216- expect ( getNotificationTypeIcon ( createSubjectMock ( { } ) ) . displayName ) . toBe (
217- 'QuestionIcon' ,
218- ) ;
219- } ) ;
220-
22126 describe ( 'getNotificationTypeIconColor' , ( ) => {
22227 it ( 'should format the notification color for check suite' , ( ) => {
22328 expect (
0 commit comments