@@ -8,118 +8,15 @@ import {
88} from '@primer/octicons-react' ;
99
1010import { IconColor } from '../types' ;
11- import type {
12- GitifyPullRequestReview ,
13- StateType ,
14- Subject ,
15- SubjectType ,
16- } from '../typesGitHub' ;
11+ import type { GitifyPullRequestReview } from '../typesGitHub' ;
1712import {
1813 getAuthMethodIcon ,
1914 getDefaultUserIcon ,
20- getNotificationTypeIconColor ,
2115 getPlatformIcon ,
2216 getPullRequestReviewIcon ,
2317} from './icons' ;
2418
2519describe ( 'renderer/utils/icons.ts' , ( ) => {
26- describe ( 'getNotificationTypeIconColor' , ( ) => {
27- it ( 'should format the notification color for check suite' , ( ) => {
28- expect (
29- getNotificationTypeIconColor (
30- createSubjectMock ( {
31- type : 'CheckSuite' ,
32- state : 'cancelled' ,
33- } ) ,
34- ) ,
35- ) . toMatchSnapshot ( ) ;
36-
37- expect (
38- getNotificationTypeIconColor (
39- createSubjectMock ( {
40- type : 'CheckSuite' ,
41- state : 'failure' ,
42- } ) ,
43- ) ,
44- ) . toMatchSnapshot ( ) ;
45-
46- expect (
47- getNotificationTypeIconColor (
48- createSubjectMock ( {
49- type : 'CheckSuite' ,
50- state : 'skipped' ,
51- } ) ,
52- ) ,
53- ) . toMatchSnapshot ( ) ;
54-
55- expect (
56- getNotificationTypeIconColor (
57- createSubjectMock ( {
58- type : 'CheckSuite' ,
59- state : 'success' ,
60- } ) ,
61- ) ,
62- ) . toMatchSnapshot ( ) ;
63-
64- expect (
65- getNotificationTypeIconColor (
66- createSubjectMock ( {
67- type : 'CheckSuite' ,
68- state : null ,
69- } ) ,
70- ) ,
71- ) . toMatchSnapshot ( ) ;
72- } ) ;
73-
74- it ( 'should format the notification color for state' , ( ) => {
75- expect (
76- getNotificationTypeIconColor ( createSubjectMock ( { state : 'ANSWERED' } ) ) ,
77- ) . toMatchSnapshot ( ) ;
78-
79- expect (
80- getNotificationTypeIconColor ( createSubjectMock ( { state : 'closed' } ) ) ,
81- ) . toMatchSnapshot ( ) ;
82-
83- expect (
84- getNotificationTypeIconColor ( createSubjectMock ( { state : 'completed' } ) ) ,
85- ) . toMatchSnapshot ( ) ;
86-
87- expect (
88- getNotificationTypeIconColor ( createSubjectMock ( { state : 'draft' } ) ) ,
89- ) . toMatchSnapshot ( ) ;
90-
91- expect (
92- getNotificationTypeIconColor ( createSubjectMock ( { state : 'merged' } ) ) ,
93- ) . toMatchSnapshot ( ) ;
94-
95- expect (
96- getNotificationTypeIconColor (
97- createSubjectMock ( { state : 'not_planned' } ) ,
98- ) ,
99- ) . toMatchSnapshot ( ) ;
100-
101- expect (
102- getNotificationTypeIconColor ( createSubjectMock ( { state : 'open' } ) ) ,
103- ) . toMatchSnapshot ( ) ;
104-
105- expect (
106- getNotificationTypeIconColor ( createSubjectMock ( { state : 'reopened' } ) ) ,
107- ) . toMatchSnapshot ( ) ;
108-
109- expect (
110- getNotificationTypeIconColor ( createSubjectMock ( { state : 'RESOLVED' } ) ) ,
111- ) . toMatchSnapshot ( ) ;
112-
113- expect (
114- getNotificationTypeIconColor (
115- createSubjectMock ( {
116- state : 'something_else_unknown' as StateType ,
117- } ) ,
118- ) ,
119- ) . toMatchSnapshot ( ) ;
120- } ) ;
121- } ) ;
122-
12320 describe ( 'getPullRequestReviewIcon' , ( ) => {
12421 let mockReviewSingleReviewer : GitifyPullRequestReview ;
12522 let mockReviewMultipleReviewer : GitifyPullRequestReview ;
@@ -235,17 +132,3 @@ describe('renderer/utils/icons.ts', () => {
235132 expect ( getDefaultUserIcon ( 'User' ) ) . toBe ( FeedPersonIcon ) ;
236133 } ) ;
237134} ) ;
238-
239- function createSubjectMock ( mocks : {
240- title ?: string ;
241- type ?: SubjectType ;
242- state ?: StateType ;
243- } ) : Subject {
244- return {
245- title : mocks . title ?? 'Mock Subject' ,
246- type : mocks . type ?? ( 'Unknown' as SubjectType ) ,
247- state : mocks . state ?? ( 'Unknown' as StateType ) ,
248- url : null ,
249- latest_comment_url : null ,
250- } ;
251- }
0 commit comments