diff --git a/src/renderer/utils/auth/utils.test.ts b/src/renderer/utils/auth/utils.test.ts index 8c3df364a..acf8fe2b8 100644 --- a/src/renderer/utils/auth/utils.test.ts +++ b/src/renderer/utils/auth/utils.test.ts @@ -65,16 +65,16 @@ describe('renderer/utils/auth/utils.ts', () => { .spyOn(comms, 'openExternalLink') .mockImplementation(vi.fn()); + beforeEach(() => { + // Mock OAUTH_DEVICE_FLOW_CLIENT_ID value + Constants.OAUTH_DEVICE_FLOW_CLIENT_ID = 'mock-oauth-client-id' as ClientID; + }); + afterEach(() => { vi.clearAllMocks(); }); describe('performGitHubDeviceOAuth', () => { - beforeEach(() => { - // Mock OAUTH_DEVICE_FLOW_CLIENT_ID value - Constants.OAUTH_DEVICE_FLOW_CLIENT_ID = 'FAKE_CLIENT_ID_123' as ClientID; - }); - it('should authenticate using device flow for GitHub app', async () => { createDeviceCodeMock.mockResolvedValueOnce({ data: { @@ -432,7 +432,7 @@ describe('renderer/utils/auth/utils.ts', () => { method: 'GitHub App', } as Account), ).toBe( - 'https://github.com/settings/connections/applications/27a352516d3341cee376', + 'https://github.com/settings/connections/applications/mock-oauth-client-id', ); expect( diff --git a/src/renderer/utils/auth/utils.ts b/src/renderer/utils/auth/utils.ts index 0ab0b6718..ea426fd62 100644 --- a/src/renderer/utils/auth/utils.ts +++ b/src/renderer/utils/auth/utils.ts @@ -314,8 +314,7 @@ export function getDeveloperSettingsURL(account: Account): Link { switch (account.method) { case 'GitHub App': - settingsURL.pathname = - '/settings/connections/applications/27a352516d3341cee376'; + settingsURL.pathname = `/settings/connections/applications/${Constants.OAUTH_DEVICE_FLOW_CLIENT_ID}`; break; case 'OAuth App': settingsURL.pathname = '/settings/developers';