mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 23:14:32 -07:00
feat(ui): display user tier in about command (#17400)
This commit is contained in:
@@ -39,6 +39,7 @@ describe('aboutCommand', () => {
|
||||
config: {
|
||||
getModel: vi.fn(),
|
||||
getIdeMode: vi.fn().mockReturnValue(true),
|
||||
getUserTierName: vi.fn().mockReturnValue(undefined),
|
||||
},
|
||||
settings: {
|
||||
merged: {
|
||||
@@ -97,6 +98,7 @@ describe('aboutCommand', () => {
|
||||
gcpProject: 'test-gcp-project',
|
||||
ideClient: 'test-ide',
|
||||
userEmail: 'test-email@example.com',
|
||||
tier: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -156,4 +158,21 @@ describe('aboutCommand', () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should display the tier when getUserTierName returns a value', async () => {
|
||||
vi.mocked(mockContext.services.config!.getUserTierName).mockReturnValue(
|
||||
'Enterprise Tier',
|
||||
);
|
||||
if (!aboutCommand.action) {
|
||||
throw new Error('The about command must have an action.');
|
||||
}
|
||||
|
||||
await aboutCommand.action(mockContext, '');
|
||||
|
||||
expect(mockContext.ui.addItem).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
tier: 'Enterprise Tier',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,6 +44,8 @@ export const aboutCommand: SlashCommand = {
|
||||
});
|
||||
const userEmail = cachedAccount ?? undefined;
|
||||
|
||||
const tier = context.services.config?.getUserTierName();
|
||||
|
||||
const aboutItem: Omit<HistoryItemAbout, 'id'> = {
|
||||
type: MessageType.ABOUT,
|
||||
cliVersion,
|
||||
@@ -54,6 +56,7 @@ export const aboutCommand: SlashCommand = {
|
||||
gcpProject,
|
||||
ideClient,
|
||||
userEmail,
|
||||
tier,
|
||||
};
|
||||
|
||||
context.ui.addItem(aboutItem);
|
||||
|
||||
Reference in New Issue
Block a user