@@ -2,7 +2,7 @@ import { act, renderHook, waitFor } from '@testing-library/react';
2
2
import axios , { AxiosError } from 'axios' ;
3
3
import nock from 'nock' ;
4
4
5
- import { mockAccounts , mockSettings , mockUser } from '../__mocks__/state-mocks' ;
5
+ import { mockAuth , mockSettings , mockUser } from '../__mocks__/state-mocks' ;
6
6
import type { AuthState } from '../types' ;
7
7
import { mockNotificationUser } from '../utils/api/__mocks__/response-mocks' ;
8
8
import { Errors } from '../utils/constants' ;
@@ -34,7 +34,7 @@ describe('hooks/useNotifications.ts', () => {
34
34
const { result } = renderHook ( ( ) => useNotifications ( ) ) ;
35
35
36
36
act ( ( ) => {
37
- result . current . fetchNotifications ( mockAccounts , {
37
+ result . current . fetchNotifications ( mockAuth , {
38
38
...mockSettings ,
39
39
detailedNotifications : false ,
40
40
} ) ;
@@ -87,7 +87,7 @@ describe('hooks/useNotifications.ts', () => {
87
87
const { result } = renderHook ( ( ) => useNotifications ( ) ) ;
88
88
89
89
act ( ( ) => {
90
- result . current . fetchNotifications ( mockAccounts , mockSettings ) ;
90
+ result . current . fetchNotifications ( mockAuth , mockSettings ) ;
91
91
} ) ;
92
92
93
93
expect ( result . current . status ) . toBe ( 'loading' ) ;
@@ -103,7 +103,7 @@ describe('hooks/useNotifications.ts', () => {
103
103
describe ( 'enterprise' , ( ) => {
104
104
it ( 'should fetch notifications with success - enterprise only' , async ( ) => {
105
105
const accounts : AuthState = {
106
- ...mockAccounts ,
106
+ ...mockAuth ,
107
107
token : null ,
108
108
} ;
109
109
@@ -137,7 +137,7 @@ describe('hooks/useNotifications.ts', () => {
137
137
138
138
it ( 'should fetch notifications with failure - enterprise only' , async ( ) => {
139
139
const accounts : AuthState = {
140
- ...mockAccounts ,
140
+ ...mockAuth ,
141
141
token : null ,
142
142
} ;
143
143
@@ -168,7 +168,7 @@ describe('hooks/useNotifications.ts', () => {
168
168
describe ( 'github.com' , ( ) => {
169
169
it ( 'should fetch notifications with success - github.com only' , async ( ) => {
170
170
const accounts : AuthState = {
171
- ...mockAccounts ,
171
+ ...mockAuth ,
172
172
enterpriseAccounts : [ ] ,
173
173
user : mockUser ,
174
174
} ;
@@ -201,7 +201,7 @@ describe('hooks/useNotifications.ts', () => {
201
201
202
202
it ( 'should fetch notifications with failures - github.com only' , async ( ) => {
203
203
const accounts : AuthState = {
204
- ...mockAccounts ,
204
+ ...mockAuth ,
205
205
enterpriseAccounts : [ ] ,
206
206
} ;
207
207
@@ -233,7 +233,7 @@ describe('hooks/useNotifications.ts', () => {
233
233
describe ( 'with detailed notifications' , ( ) => {
234
234
it ( 'should fetch notifications with success' , async ( ) => {
235
235
const accounts : AuthState = {
236
- ...mockAccounts ,
236
+ ...mockAuth ,
237
237
enterpriseAccounts : [ ] ,
238
238
user : mockUser ,
239
239
} ;
@@ -429,7 +429,7 @@ describe('hooks/useNotifications.ts', () => {
429
429
const { result } = renderHook ( ( ) => useNotifications ( ) ) ;
430
430
431
431
act ( ( ) => {
432
- result . current . fetchNotifications ( mockAccounts , {
432
+ result . current . fetchNotifications ( mockAuth , {
433
433
...mockSettings ,
434
434
detailedNotifications : false ,
435
435
} ) ;
@@ -455,7 +455,7 @@ describe('hooks/useNotifications.ts', () => {
455
455
const id = 'notification-123' ;
456
456
457
457
describe ( 'github.com' , ( ) => {
458
- const accounts = { ...mockAccounts , enterpriseAccounts : [ ] } ;
458
+ const accounts = { ...mockAuth , enterpriseAccounts : [ ] } ;
459
459
const hostname = 'github.com' ;
460
460
461
461
it ( 'should mark a notification as read with success - github.com' , async ( ) => {
@@ -506,7 +506,7 @@ describe('hooks/useNotifications.ts', () => {
506
506
} ) ;
507
507
508
508
describe ( 'enterprise' , ( ) => {
509
- const accounts = { ...mockAccounts , token : null } ;
509
+ const accounts = { ...mockAuth , token : null } ;
510
510
const hostname = 'github.gitify.io' ;
511
511
512
512
it ( 'should mark a notification as read with success - enterprise' , async ( ) => {
@@ -561,7 +561,7 @@ describe('hooks/useNotifications.ts', () => {
561
561
const id = 'notification-123' ;
562
562
563
563
describe ( 'github.com' , ( ) => {
564
- const accounts = { ...mockAccounts , enterpriseAccounts : [ ] } ;
564
+ const accounts = { ...mockAuth , enterpriseAccounts : [ ] } ;
565
565
const hostname = 'github.com' ;
566
566
567
567
it ( 'should mark a notification as done with success - github.com' , async ( ) => {
@@ -612,7 +612,7 @@ describe('hooks/useNotifications.ts', () => {
612
612
} ) ;
613
613
614
614
describe ( 'enterprise' , ( ) => {
615
- const accounts = { ...mockAccounts , token : null } ;
615
+ const accounts = { ...mockAuth , token : null } ;
616
616
const hostname = 'github.gitify.io' ;
617
617
618
618
it ( 'should mark a notification as done with success - enterprise' , async ( ) => {
@@ -667,7 +667,7 @@ describe('hooks/useNotifications.ts', () => {
667
667
const id = 'notification-123' ;
668
668
669
669
describe ( 'github.com' , ( ) => {
670
- const accounts = { ...mockAccounts , enterpriseAccounts : [ ] } ;
670
+ const accounts = { ...mockAuth , enterpriseAccounts : [ ] } ;
671
671
const hostname = 'github.com' ;
672
672
673
673
it ( 'should unsubscribe from a notification with success - github.com' , async ( ) => {
@@ -730,7 +730,7 @@ describe('hooks/useNotifications.ts', () => {
730
730
} ) ;
731
731
732
732
describe ( 'enterprise' , ( ) => {
733
- const accounts = { ...mockAccounts , token : null } ;
733
+ const accounts = { ...mockAuth , token : null } ;
734
734
const hostname = 'github.gitify.io' ;
735
735
736
736
it ( 'should unsubscribe from a notification with success - enterprise' , async ( ) => {
@@ -797,7 +797,7 @@ describe('hooks/useNotifications.ts', () => {
797
797
const repoSlug = 'gitify-app/notifications-test' ;
798
798
799
799
describe ( 'github.com' , ( ) => {
800
- const accounts = { ...mockAccounts , enterpriseAccounts : [ ] } ;
800
+ const accounts = { ...mockAuth , enterpriseAccounts : [ ] } ;
801
801
const hostname = 'github.com' ;
802
802
803
803
it ( "should mark a repository's notifications as read with success - github.com" , async ( ) => {
@@ -848,7 +848,7 @@ describe('hooks/useNotifications.ts', () => {
848
848
} ) ;
849
849
850
850
describe ( 'enterprise' , ( ) => {
851
- const accounts = { ...mockAccounts , token : null } ;
851
+ const accounts = { ...mockAuth , token : null } ;
852
852
const hostname = 'github.gitify.io' ;
853
853
854
854
it ( "should mark a repository's notifications as read with success - enterprise" , async ( ) => {
@@ -904,7 +904,7 @@ describe('hooks/useNotifications.ts', () => {
904
904
const id = 'notification-123' ;
905
905
906
906
describe ( 'github.com' , ( ) => {
907
- const accounts = { ...mockAccounts , enterpriseAccounts : [ ] } ;
907
+ const accounts = { ...mockAuth , enterpriseAccounts : [ ] } ;
908
908
const hostname = 'github.com' ;
909
909
910
910
it ( "should mark a repository's notifications as done with success - github.com" , async ( ) => {
@@ -955,7 +955,7 @@ describe('hooks/useNotifications.ts', () => {
955
955
} ) ;
956
956
957
957
describe ( 'enterprise' , ( ) => {
958
- const accounts = { ...mockAccounts , token : null } ;
958
+ const accounts = { ...mockAuth , token : null } ;
959
959
const hostname = 'github.gitify.io' ;
960
960
961
961
it ( "should mark a repository's notifications as done with success - enterprise" , async ( ) => {
0 commit comments