11import userEvent from '@testing-library/user-event' ;
22
3- import { navigateMock , renderWithAppContext } from '../__helpers__/test-utils' ;
3+ import { navigateMock , renderWithProviders } from '../__helpers__/test-utils' ;
44
55import * as comms from '../utils/system/comms' ;
66import * as links from '../utils/system/links' ;
@@ -14,7 +14,7 @@ describe('components/GlobalShortcuts.tsx', () => {
1414 describe ( 'key bindings' , ( ) => {
1515 describe ( 'ignores keys that are not valid' , ( ) => {
1616 it ( 'ignores B key' , async ( ) => {
17- renderWithAppContext ( < GlobalShortcuts /> ) ;
17+ renderWithProviders ( < GlobalShortcuts /> ) ;
1818
1919 await userEvent . keyboard ( 'b' ) ;
2020
@@ -24,7 +24,7 @@ describe('components/GlobalShortcuts.tsx', () => {
2424
2525 describe ( 'home' , ( ) => {
2626 it ( 'navigates home when pressing H key' , async ( ) => {
27- renderWithAppContext ( < GlobalShortcuts /> ) ;
27+ renderWithProviders ( < GlobalShortcuts /> ) ;
2828
2929 await userEvent . keyboard ( 'h' ) ;
3030
@@ -38,7 +38,7 @@ describe('components/GlobalShortcuts.tsx', () => {
3838 . mockImplementation ( vi . fn ( ) ) ;
3939
4040 it ( 'opens primary account GitHub notifications webpage when pressing N while logged in' , async ( ) => {
41- renderWithAppContext ( < GlobalShortcuts /> , {
41+ renderWithProviders ( < GlobalShortcuts /> , {
4242 isLoggedIn : true ,
4343 } ) ;
4444
@@ -48,7 +48,7 @@ describe('components/GlobalShortcuts.tsx', () => {
4848 } ) ;
4949
5050 it ( 'does not open primary account GitHub notifications webpage when logged out' , async ( ) => {
51- renderWithAppContext ( < GlobalShortcuts /> , {
51+ renderWithProviders ( < GlobalShortcuts /> , {
5252 isLoggedIn : false ,
5353 } ) ;
5454
@@ -60,7 +60,7 @@ describe('components/GlobalShortcuts.tsx', () => {
6060
6161 describe ( 'focus mode' , ( ) => {
6262 it ( 'toggles focus when pressing W while logged in' , async ( ) => {
63- renderWithAppContext ( < GlobalShortcuts /> , {
63+ renderWithProviders ( < GlobalShortcuts /> , {
6464 updateSetting : updateSettingMock ,
6565 isLoggedIn : true ,
6666 } ) ;
@@ -71,7 +71,7 @@ describe('components/GlobalShortcuts.tsx', () => {
7171 } ) ;
7272
7373 it ( 'does not toggle focus mode when loading' , async ( ) => {
74- renderWithAppContext ( < GlobalShortcuts /> , {
74+ renderWithProviders ( < GlobalShortcuts /> , {
7575 updateSetting : updateSettingMock ,
7676 status : 'loading' ,
7777 isLoggedIn : true ,
@@ -83,7 +83,7 @@ describe('components/GlobalShortcuts.tsx', () => {
8383 } ) ;
8484
8585 it ( 'does not toggle focus mode when logged out' , async ( ) => {
86- renderWithAppContext ( < GlobalShortcuts /> , {
86+ renderWithProviders ( < GlobalShortcuts /> , {
8787 updateSetting : updateSettingMock ,
8888 isLoggedIn : false ,
8989 } ) ;
@@ -96,7 +96,7 @@ describe('components/GlobalShortcuts.tsx', () => {
9696
9797 describe ( 'filters' , ( ) => {
9898 it ( 'toggles filters when pressing F while logged in' , async ( ) => {
99- renderWithAppContext ( < GlobalShortcuts /> , {
99+ renderWithProviders ( < GlobalShortcuts /> , {
100100 isLoggedIn : true ,
101101 } ) ;
102102
@@ -106,7 +106,7 @@ describe('components/GlobalShortcuts.tsx', () => {
106106 } ) ;
107107
108108 it ( 'does not toggle filters when logged out' , async ( ) => {
109- renderWithAppContext ( < GlobalShortcuts /> , {
109+ renderWithProviders ( < GlobalShortcuts /> , {
110110 isLoggedIn : false ,
111111 } ) ;
112112
@@ -122,7 +122,7 @@ describe('components/GlobalShortcuts.tsx', () => {
122122 . mockImplementation ( vi . fn ( ) ) ;
123123
124124 it ( 'opens primary account GitHub issues webpage when pressing I while logged in' , async ( ) => {
125- renderWithAppContext ( < GlobalShortcuts /> , {
125+ renderWithProviders ( < GlobalShortcuts /> , {
126126 isLoggedIn : true ,
127127 } ) ;
128128
@@ -132,7 +132,7 @@ describe('components/GlobalShortcuts.tsx', () => {
132132 } ) ;
133133
134134 it ( 'does not open primary account GitHub issues webpage when logged out' , async ( ) => {
135- renderWithAppContext ( < GlobalShortcuts /> , {
135+ renderWithProviders ( < GlobalShortcuts /> , {
136136 isLoggedIn : false ,
137137 } ) ;
138138
@@ -148,7 +148,7 @@ describe('components/GlobalShortcuts.tsx', () => {
148148 . mockImplementation ( vi . fn ( ) ) ;
149149
150150 it ( 'opens primary account GitHub pull requests webpage when pressing N while logged in' , async ( ) => {
151- renderWithAppContext ( < GlobalShortcuts /> , {
151+ renderWithProviders ( < GlobalShortcuts /> , {
152152 isLoggedIn : true ,
153153 } ) ;
154154
@@ -158,7 +158,7 @@ describe('components/GlobalShortcuts.tsx', () => {
158158 } ) ;
159159
160160 it ( 'does not open primary account GitHub pull requests webpage when logged out' , async ( ) => {
161- renderWithAppContext ( < GlobalShortcuts /> , {
161+ renderWithProviders ( < GlobalShortcuts /> , {
162162 isLoggedIn : false ,
163163 } ) ;
164164
@@ -170,7 +170,7 @@ describe('components/GlobalShortcuts.tsx', () => {
170170
171171 describe ( 'refresh' , ( ) => {
172172 it ( 'refreshes notifications when pressing R key' , async ( ) => {
173- renderWithAppContext ( < GlobalShortcuts /> , {
173+ renderWithProviders ( < GlobalShortcuts /> , {
174174 fetchNotifications : fetchNotificationsMock ,
175175 } ) ;
176176
@@ -181,7 +181,7 @@ describe('components/GlobalShortcuts.tsx', () => {
181181 } ) ;
182182
183183 it ( 'does not refresh when status is loading' , async ( ) => {
184- renderWithAppContext ( < GlobalShortcuts /> , {
184+ renderWithProviders ( < GlobalShortcuts /> , {
185185 status : 'loading' ,
186186 } ) ;
187187
@@ -193,7 +193,7 @@ describe('components/GlobalShortcuts.tsx', () => {
193193
194194 describe ( 'settings' , ( ) => {
195195 it ( 'toggles settings when pressing S while logged in' , async ( ) => {
196- renderWithAppContext ( < GlobalShortcuts /> , {
196+ renderWithProviders ( < GlobalShortcuts /> , {
197197 isLoggedIn : true ,
198198 } ) ;
199199
@@ -203,7 +203,7 @@ describe('components/GlobalShortcuts.tsx', () => {
203203 } ) ;
204204
205205 it ( 'does not toggle settings when logged out' , async ( ) => {
206- renderWithAppContext ( < GlobalShortcuts /> , {
206+ renderWithProviders ( < GlobalShortcuts /> , {
207207 isLoggedIn : false ,
208208 } ) ;
209209
@@ -215,7 +215,7 @@ describe('components/GlobalShortcuts.tsx', () => {
215215
216216 describe ( 'accounts' , ( ) => {
217217 it ( 'navigates to accounts when pressing A on settings route' , async ( ) => {
218- renderWithAppContext ( < GlobalShortcuts /> , {
218+ renderWithProviders ( < GlobalShortcuts /> , {
219219 initialEntries : [ '/settings' ] ,
220220 isLoggedIn : true ,
221221 } ) ;
@@ -226,7 +226,7 @@ describe('components/GlobalShortcuts.tsx', () => {
226226 } ) ;
227227
228228 it ( 'does not trigger accounts when not on settings route' , async ( ) => {
229- renderWithAppContext ( < GlobalShortcuts /> , {
229+ renderWithProviders ( < GlobalShortcuts /> , {
230230 isLoggedIn : true ,
231231 } ) ;
232232
@@ -238,7 +238,7 @@ describe('components/GlobalShortcuts.tsx', () => {
238238
239239 describe ( 'quit app' , ( ) => {
240240 it ( 'quits the app when pressing Q on settings route' , async ( ) => {
241- renderWithAppContext ( < GlobalShortcuts /> , {
241+ renderWithProviders ( < GlobalShortcuts /> , {
242242 initialEntries : [ '/settings' ] ,
243243 isLoggedIn : true ,
244244 } ) ;
@@ -249,7 +249,7 @@ describe('components/GlobalShortcuts.tsx', () => {
249249 } ) ;
250250
251251 it ( 'does not quit the app when not on settings route' , async ( ) => {
252- renderWithAppContext ( < GlobalShortcuts /> , {
252+ renderWithProviders ( < GlobalShortcuts /> , {
253253 isLoggedIn : true ,
254254 } ) ;
255255
@@ -261,7 +261,7 @@ describe('components/GlobalShortcuts.tsx', () => {
261261
262262 describe ( 'modifiers' , ( ) => {
263263 it ( 'ignores shortcuts when typing in an input' , async ( ) => {
264- renderWithAppContext (
264+ renderWithProviders (
265265 < >
266266 < GlobalShortcuts />
267267 < input id = "test-input" />
@@ -281,7 +281,7 @@ describe('components/GlobalShortcuts.tsx', () => {
281281 } ) ;
282282
283283 it ( 'ignores shortcuts when typing in a textarea' , async ( ) => {
284- renderWithAppContext (
284+ renderWithProviders (
285285 < >
286286 < GlobalShortcuts />
287287 < textarea id = "test-textarea" />
@@ -301,7 +301,7 @@ describe('components/GlobalShortcuts.tsx', () => {
301301 } ) ;
302302
303303 it ( 'ignores shortcuts when modifier keys are pressed' , async ( ) => {
304- renderWithAppContext ( < GlobalShortcuts /> , {
304+ renderWithProviders ( < GlobalShortcuts /> , {
305305 isLoggedIn : true ,
306306 } ) ;
307307
0 commit comments