@@ -83,11 +83,32 @@ describe('utils/api/client.ts', () => {
83
83
} ) ;
84
84
85
85
describe ( 'listNotificationsForAuthenticatedUser' , ( ) => {
86
- const mockSettings : Partial < SettingsState > = {
87
- participating : true ,
88
- } ;
86
+ it ( 'should list notifications for user - github cloud - fetchAllNotifications true' , async ( ) => {
87
+ const mockSettings : Partial < SettingsState > = {
88
+ participating : true ,
89
+ fetchAllNotifications : true ,
90
+ } ;
91
+
92
+ await listNotificationsForAuthenticatedUser (
93
+ mockGitHubCloudAccount ,
94
+ mockSettings as SettingsState ,
95
+ ) ;
96
+
97
+ expect ( axios ) . toHaveBeenCalledWith ( {
98
+ url : 'https://api.github.com/notifications?participating=true' ,
99
+ method : 'GET' ,
100
+ data : { } ,
101
+ } ) ;
102
+
103
+ expect ( axios . defaults . headers . common ) . toMatchSnapshot ( ) ;
104
+ } ) ;
105
+
106
+ it ( 'should list notifications for user - github cloud - fetchAllNotifications false' , async ( ) => {
107
+ const mockSettings : Partial < SettingsState > = {
108
+ participating : true ,
109
+ fetchAllNotifications : false ,
110
+ } ;
89
111
90
- it ( 'should list notifications for user - github cloud' , async ( ) => {
91
112
await listNotificationsForAuthenticatedUser (
92
113
mockGitHubCloudAccount ,
93
114
mockSettings as SettingsState ,
@@ -103,6 +124,10 @@ describe('utils/api/client.ts', () => {
103
124
} ) ;
104
125
105
126
it ( 'should list notifications for user - github enterprise server' , async ( ) => {
127
+ const mockSettings : Partial < SettingsState > = {
128
+ participating : true ,
129
+ } ;
130
+
106
131
await listNotificationsForAuthenticatedUser (
107
132
mockGitHubEnterpriseServerAccount ,
108
133
mockSettings as SettingsState ,
0 commit comments