mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-23 20:40:41 -07:00
fix(core): prioritize detailed error messages for code assist setup (#17852)
This commit is contained in:
@@ -312,6 +312,32 @@ describe('setupUser for new user', () => {
|
||||
userTierName: 'paid',
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw ineligible tier error when onboarding fails and ineligible tiers exist', async () => {
|
||||
vi.stubEnv('GOOGLE_CLOUD_PROJECT', '');
|
||||
mockLoad.mockResolvedValue({
|
||||
allowedTiers: [mockPaidTier],
|
||||
ineligibleTiers: [
|
||||
{
|
||||
reasonCode: 'UNSUPPORTED_LOCATION',
|
||||
reasonMessage:
|
||||
'Your current account is not eligible for Gemini Code Assist for individuals because it is not currently available in your location.',
|
||||
tierId: 'free-tier',
|
||||
tierName: 'Gemini Code Assist for individuals',
|
||||
},
|
||||
],
|
||||
});
|
||||
mockOnboardUser.mockResolvedValue({
|
||||
done: true,
|
||||
response: {
|
||||
cloudaicompanionProject: {},
|
||||
},
|
||||
});
|
||||
|
||||
await expect(setupUser({} as OAuth2Client)).rejects.toThrow(
|
||||
'Your current account is not eligible for Gemini Code Assist for individuals because it is not currently available in your location.',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('setupUser validation', () => {
|
||||
|
||||
Reference in New Issue
Block a user