@@ -3,8 +3,6 @@ import { act, renderHook, waitFor } from '@testing-library/react';
33import axios , { AxiosError } from 'axios' ;
44import nock from 'nock' ;
55
6- import * as logger from '../../shared/logger' ;
7-
86import {
97 mockAuth ,
108 mockGitHubCloudAccount ,
@@ -16,16 +14,19 @@ import {
1614 mockSingleNotification ,
1715} from '../utils/api/__mocks__/response-mocks' ;
1816import { Errors } from '../utils/errors' ;
17+ import * as logger from '../utils/logger' ;
1918import { useNotifications } from './useNotifications' ;
2019
2120describe ( 'renderer/hooks/useNotifications.ts' , ( ) => {
22- const logErrorSpy = jest . spyOn ( logger , 'logError' ) . mockImplementation ( ) ;
21+ const rendererLogErrorSpy = jest
22+ . spyOn ( logger , 'rendererLogError' )
23+ . mockImplementation ( ) ;
2324
2425 beforeEach ( ( ) => {
2526 // axios will default to using the XHR adapter which can't be intercepted
2627 // by nock. So, configure axios to use the node adapter.
2728 axios . defaults . adapter = 'http' ;
28- logErrorSpy . mockReset ( ) ;
29+ rendererLogErrorSpy . mockReset ( ) ;
2930 } ) ;
3031
3132 const id = mockSingleNotification . id ;
@@ -300,7 +301,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
300301 } ) ;
301302
302303 expect ( result . current . globalError ) . toBe ( Errors . BAD_CREDENTIALS ) ;
303- expect ( logErrorSpy ) . toHaveBeenCalledTimes ( 4 ) ;
304+ expect ( rendererLogErrorSpy ) . toHaveBeenCalledTimes ( 4 ) ;
304305 } ) ;
305306
306307 it ( 'should fetch notifications with different failures' , async ( ) => {
@@ -343,7 +344,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
343344 } ) ;
344345
345346 expect ( result . current . globalError ) . toBeNull ( ) ;
346- expect ( logErrorSpy ) . toHaveBeenCalledTimes ( 4 ) ;
347+ expect ( rendererLogErrorSpy ) . toHaveBeenCalledTimes ( 4 ) ;
347348 } ) ;
348349 } ) ;
349350
@@ -386,7 +387,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
386387 } ) ;
387388
388389 expect ( result . current . notifications . length ) . toBe ( 0 ) ;
389- expect ( logErrorSpy ) . toHaveBeenCalledTimes ( 1 ) ;
390+ expect ( rendererLogErrorSpy ) . toHaveBeenCalledTimes ( 1 ) ;
390391 } ) ;
391392 } ) ;
392393
@@ -429,7 +430,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
429430 } ) ;
430431
431432 expect ( result . current . notifications . length ) . toBe ( 0 ) ;
432- expect ( logErrorSpy ) . toHaveBeenCalledTimes ( 1 ) ;
433+ expect ( rendererLogErrorSpy ) . toHaveBeenCalledTimes ( 1 ) ;
433434 } ) ;
434435 } ) ;
435436
@@ -521,7 +522,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
521522 } ) ;
522523
523524 expect ( result . current . notifications . length ) . toBe ( 0 ) ;
524- expect ( logErrorSpy ) . toHaveBeenCalledTimes ( 1 ) ;
525+ expect ( rendererLogErrorSpy ) . toHaveBeenCalledTimes ( 1 ) ;
525526 } ) ;
526527 } ) ;
527528} ) ;
0 commit comments