@@ -4,9 +4,17 @@ import {
44 mockAccountNotifications ,
55 mockSingleAccountNotifications ,
66} from '../../__mocks__/notifications-mocks' ;
7+ import * as helpers from '../helpers' ;
78import * as native from './native' ;
89
910describe ( 'renderer/utils/notifications/native.ts' , ( ) => {
11+ const mockHtmlUrl =
12+ mockSingleAccountNotifications [ 0 ] . notifications [ 0 ] . repository . html_url ;
13+
14+ jest
15+ . spyOn ( helpers , 'generateGitHubWebUrl' )
16+ . mockImplementation ( async ( ) => mockHtmlUrl ) ;
17+
1018 afterEach ( ( ) => {
1119 jest . clearAllMocks ( ) ;
1220 } ) ;
@@ -28,10 +36,9 @@ describe('renderer/utils/notifications/native.ts', () => {
2836 expect . stringContaining (
2937 mockSingleAccountNotifications [ 0 ] . notifications [ 0 ] . subject . title ,
3038 ) ,
31- expect . stringContaining (
32- mockSingleAccountNotifications [ 0 ] . notifications [ 0 ] . repository . html_url ,
33- ) ,
39+ expect . stringContaining ( mockHtmlUrl ) ,
3440 ) ;
41+ expect ( helpers . generateGitHubWebUrl ) . toHaveBeenCalledTimes ( 1 ) ;
3542 } ) ;
3643
3744 it ( 'should raise a native notification for multiple new notifications' , async ( ) => {
@@ -46,5 +53,6 @@ describe('renderer/utils/notifications/native.ts', () => {
4653 'You have 2 notifications' ,
4754 null ,
4855 ) ;
56+ expect ( helpers . generateGitHubWebUrl ) . toHaveBeenCalledTimes ( 0 ) ;
4957 } ) ;
5058} ) ;
0 commit comments