mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
remove hardcoded tiername when missing tier (#21022)
This commit is contained in:
@@ -47,6 +47,7 @@ describe('<UserIdentity />', () => {
|
|||||||
const output = lastFrame();
|
const output = lastFrame();
|
||||||
expect(output).toContain('test@example.com');
|
expect(output).toContain('test@example.com');
|
||||||
expect(output).toContain('/auth');
|
expect(output).toContain('/auth');
|
||||||
|
expect(output).not.toContain('/upgrade');
|
||||||
unmount();
|
unmount();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -74,6 +75,7 @@ describe('<UserIdentity />', () => {
|
|||||||
const output = lastFrame();
|
const output = lastFrame();
|
||||||
expect(output).toContain('Logged in with Google');
|
expect(output).toContain('Logged in with Google');
|
||||||
expect(output).toContain('/auth');
|
expect(output).toContain('/auth');
|
||||||
|
expect(output).not.toContain('/upgrade');
|
||||||
unmount();
|
unmount();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -130,6 +132,26 @@ describe('<UserIdentity />', () => {
|
|||||||
const output = lastFrame();
|
const output = lastFrame();
|
||||||
expect(output).toContain(`Authenticated with ${AuthType.USE_GEMINI}`);
|
expect(output).toContain(`Authenticated with ${AuthType.USE_GEMINI}`);
|
||||||
expect(output).toContain('/auth');
|
expect(output).toContain('/auth');
|
||||||
|
expect(output).not.toContain('/upgrade');
|
||||||
|
unmount();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render specific tier name when provided', async () => {
|
||||||
|
const mockConfig = makeFakeConfig();
|
||||||
|
vi.spyOn(mockConfig, 'getContentGeneratorConfig').mockReturnValue({
|
||||||
|
authType: AuthType.LOGIN_WITH_GOOGLE,
|
||||||
|
model: 'gemini-pro',
|
||||||
|
} as unknown as ContentGeneratorConfig);
|
||||||
|
vi.spyOn(mockConfig, 'getUserTierName').mockReturnValue('Enterprise Tier');
|
||||||
|
|
||||||
|
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||||
|
<UserIdentity config={mockConfig} />,
|
||||||
|
);
|
||||||
|
await waitUntilReady();
|
||||||
|
|
||||||
|
const output = lastFrame();
|
||||||
|
expect(output).toContain('Enterprise Tier');
|
||||||
|
expect(output).toContain('/upgrade');
|
||||||
unmount();
|
unmount();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,12 +53,14 @@ export const UserIdentity: React.FC<UserIdentityProps> = ({ config }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Tier Name /upgrade */}
|
{/* Tier Name /upgrade */}
|
||||||
|
{tierName && (
|
||||||
<Box>
|
<Box>
|
||||||
<Text color={theme.text.primary} wrap="truncate-end">
|
<Text color={theme.text.primary} wrap="truncate-end">
|
||||||
{tierName ?? 'Gemini Code Assist for individuals'}
|
{tierName}
|
||||||
</Text>
|
</Text>
|
||||||
<Text color={theme.text.secondary}> /upgrade</Text>
|
<Text color={theme.text.secondary}> /upgrade</Text>
|
||||||
</Box>
|
</Box>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user