summaryrefslogtreecommitdiff
path: root/packages/core/src/code_assist/oauth2.test.ts
diff options
context:
space:
mode:
authorGaurav <[email protected]>2025-07-09 21:17:40 -0700
committerGitHub <[email protected]>2025-07-10 04:17:40 +0000
commitb7f8e1360fc13c077c24c98fe9d85e0734195000 (patch)
tree09bad91a13c35017b4c02fab6169c151e24adb68 /packages/core/src/code_assist/oauth2.test.ts
parentda50a1eefbd0751aaf137882595d500e6b6b4179 (diff)
fix: Use Email for Clearcut Logging and Refactor User Info Fetching (#3620)
Diffstat (limited to 'packages/core/src/code_assist/oauth2.test.ts')
-rw-r--r--packages/core/src/code_assist/oauth2.test.ts19
1 files changed, 0 insertions, 19 deletions
diff --git a/packages/core/src/code_assist/oauth2.test.ts b/packages/core/src/code_assist/oauth2.test.ts
index 76d43726..58081e6a 100644
--- a/packages/core/src/code_assist/oauth2.test.ts
+++ b/packages/core/src/code_assist/oauth2.test.ts
@@ -61,30 +61,11 @@ describe('oauth2', () => {
const mockGetAccessToken = vi
.fn()
.mockResolvedValue({ token: 'mock-access-token' });
- const mockRefreshAccessToken = vi.fn().mockImplementation((callback) => {
- // Mock the callback-style refreshAccessToken method
- const mockTokensWithIdToken = {
- access_token: 'test-access-token',
- refresh_token: 'test-refresh-token',
- id_token:
- 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0LWdvb2dsZS1hY2NvdW50LWlkLTEyMyJ9.signature', // Mock JWT with sub: test-google-account-id-123
- };
- callback(null, mockTokensWithIdToken);
- });
- const mockVerifyIdToken = vi.fn().mockResolvedValue({
- getPayload: () => ({
- sub: 'test-google-account-id-123',
- aud: 'test-audience',
- iss: 'https://accounts.google.com',
- }),
- });
const mockOAuth2Client = {
generateAuthUrl: mockGenerateAuthUrl,
getToken: mockGetToken,
setCredentials: mockSetCredentials,
getAccessToken: mockGetAccessToken,
- refreshAccessToken: mockRefreshAccessToken,
- verifyIdToken: mockVerifyIdToken,
credentials: mockTokens,
on: vi.fn(),
} as unknown as OAuth2Client;