File tree Expand file tree Collapse file tree
src/renderer/utils/notifications/handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { mockPartialGitifyNotification } from '../../../__mocks__/notifications-mocks' ;
2+
3+ import type { GitifyNotification , Link } from '../../../types' ;
4+
5+ import { repositoryAdvisoryHandler } from './repositoryAdvisory' ;
6+
7+ describe ( 'renderer/utils/notifications/handlers/repositoryAdvisory.ts' , ( ) => {
8+ it ( 'iconType' , ( ) => {
9+ const mockNotification = mockPartialGitifyNotification ( {
10+ type : 'RepositoryAdvisory' ,
11+ } ) ;
12+
13+ expect (
14+ repositoryAdvisoryHandler . iconType ( mockNotification ) . displayName ,
15+ ) . toBe ( 'AlertIcon' ) ;
16+ } ) ;
17+
18+ it ( 'defaultUrl' , ( ) => {
19+ const mockHtmlUrl =
20+ 'https://github.com/gitify-app/notifications-test' as Link ;
21+
22+ expect (
23+ repositoryAdvisoryHandler . defaultUrl ( {
24+ repository : {
25+ htmlUrl : mockHtmlUrl ,
26+ } ,
27+ } as GitifyNotification ) ,
28+ ) . toEqual ( `${ mockHtmlUrl } /security/advisories` ) ;
29+ } ) ;
30+
31+ it ( 'defaultUserType' , ( ) => {
32+ expect ( repositoryAdvisoryHandler . defaultUserType ( ) ) . toEqual ( 'Bot' ) ;
33+ } ) ;
34+ } ) ;
You can’t perform that action at this time.
0 commit comments