11import { Constants } from '../constants' ;
22import type {
33 AccountNotifications ,
4+ GitifyNotification ,
45 GitifyNotificationState ,
6+ GitifyRepository ,
7+ GitifySubject ,
58 Hostname ,
6- } from '../types' ;
7- import type {
8- Notification ,
9- Repository ,
10- Subject ,
9+ Link ,
1110 SubjectType ,
12- } from '../typesGitHub ' ;
11+ } from '../types ' ;
1312import {
1413 mockEnterpriseNotifications ,
1514 mockGitHubNotifications ,
@@ -47,21 +46,21 @@ export function createMockSubject(mocks: {
4746 title ?: string ;
4847 type ?: SubjectType ;
4948 state ?: GitifyNotificationState ;
50- } ) : Subject {
49+ } ) : GitifySubject {
5150 return {
5251 title : mocks . title ?? 'Mock Subject' ,
5352 type : mocks . type ?? ( 'Unknown' as SubjectType ) ,
5453 state : mocks . state ?? ( 'Unknown' as GitifyNotificationState ) ,
5554 url : null ,
56- latest_comment_url : null ,
55+ latestCommentUrl : null ,
5756 } ;
5857}
5958
6059export function createPartialMockNotification (
61- subject : Partial < Subject > ,
62- repository ?: Partial < Repository > ,
63- ) : Notification {
64- const mockNotification : Partial < Notification > = {
60+ subject : Partial < GitifySubject > ,
61+ repository ?: Partial < GitifyRepository > ,
62+ ) : GitifyNotification {
63+ const mockNotification : Partial < GitifyNotification > = {
6564 account : {
6665 method : 'Personal Access Token' ,
6766 platform : 'GitHub Cloud' ,
@@ -70,28 +69,30 @@ export function createPartialMockNotification(
7069 user : mockGitifyUser ,
7170 hasRequiredScopes : true ,
7271 } ,
73- subject : subject as Subject ,
72+ subject : subject as GitifySubject ,
7473 repository : {
7574 name : 'notifications-test' ,
76- full_name : 'gitify-app/notifications-test' ,
77- html_url : 'https://github.com/gitify-app/notifications-test' ,
75+ fullName : 'gitify-app/notifications-test' ,
76+ htmlUrl : 'https://github.com/gitify-app/notifications-test' as Link ,
7877 owner : {
7978 login : 'gitify-app' ,
79+ avatarUrl : 'https://avatars.githubusercontent.com/u/1' as Link ,
80+ type : 'Organization' ,
8081 } ,
8182 ...repository ,
82- } as Repository ,
83+ } as GitifyRepository ,
8384 } ;
8485
85- return mockNotification as Notification ;
86+ return mockNotification as GitifyNotification ;
8687}
8788
8889export function createMockNotificationForRepoName (
8990 id : string ,
9091 repoFullName : string | null ,
91- ) : Notification {
92+ ) : GitifyNotification {
9293 return {
9394 id,
94- repository : repoFullName ? { full_name : repoFullName } : null ,
95+ repository : repoFullName ? { fullName : repoFullName } : null ,
9596 account : mockGitHubCloudAccount ,
96- } as Notification ;
97+ } as GitifyNotification ;
9798}
0 commit comments