@@ -10,17 +10,8 @@ import { Constants } from '../constants';
1010import { useAppContext } from '../hooks/useAppContext' ;
1111import { useNotifications } from '../hooks/useNotifications' ;
1212
13- import type {
14- AuthState ,
15- ClientID ,
16- ClientSecret ,
17- Hostname ,
18- SettingsState ,
19- Token ,
20- } from '../types' ;
21- import type { GetAuthenticatedUserResponse } from '../utils/api/types' ;
22-
23- import * as apiClient from '../utils/api/client' ;
13+ import type { AuthState , SettingsState } from '../types' ;
14+
2415import * as notifications from '../utils/notifications/notifications' ;
2516import * as storage from '../utils/storage' ;
2617import * as tray from '../utils/tray' ;
@@ -73,8 +64,6 @@ describe('renderer/context/App.tsx', () => {
7364 . spyOn ( storage , 'saveState' )
7465 . mockImplementation ( jest . fn ( ) ) ;
7566
76- const mockAuthenticatedResponse = mockRawUser ( 'authenticated-user' ) ;
77-
7867 beforeEach ( ( ) => {
7968 jest . useFakeTimers ( ) ;
8069 ( useNotifications as jest . Mock ) . mockReturnValue ( {
@@ -194,43 +183,6 @@ describe('renderer/context/App.tsx', () => {
194183 } ) ;
195184 } ) ;
196185
197- describe ( 'authentication methods' , ( ) => {
198- jest . spyOn ( apiClient , 'fetchAuthenticatedUserDetails' ) . mockResolvedValue ( {
199- status : 200 ,
200- url : 'https://api.github.com/user' ,
201- data : mockAuthenticatedResponse as GetAuthenticatedUserResponse ,
202- headers : {
203- 'x-oauth-scopes' : Constants . OAUTH_SCOPES . RECOMMENDED . join ( ', ' ) ,
204- } ,
205- } ) ;
206-
207- it ( 'should call loginWithOAuthApp' , async ( ) => {
208- const { button } = renderContextButton ( 'loginWithOAuthApp' , {
209- hostname : 'github.com' as Hostname ,
210- clientId : 'FAKE_CLIENT_ID_123' as ClientID ,
211- clientSecret : 'FAKE_CLIENT_SECRET_123' as ClientSecret ,
212- } ) ;
213- fireEvent . click ( button ) ;
214-
215- await waitFor ( ( ) =>
216- expect ( mockFetchNotifications ) . toHaveBeenCalledTimes ( 1 ) ,
217- ) ;
218- } ) ;
219-
220- it ( 'should call loginWithPersonalAccessToken' , async ( ) => {
221- const { button } = renderContextButton ( 'loginWithPersonalAccessToken' , {
222- hostname : 'github.com' as Hostname ,
223- token : '123-456' as Token ,
224- } ) ;
225-
226- fireEvent . click ( button ) ;
227-
228- await waitFor ( ( ) =>
229- expect ( mockFetchNotifications ) . toHaveBeenCalledTimes ( 1 ) ,
230- ) ;
231- } ) ;
232- } ) ;
233-
234186 describe ( 'settings methods' , ( ) => {
235187 const saveStateSpy = jest
236188 . spyOn ( storage , 'saveState' )
0 commit comments