feat(cli): add user identity info to stats command (#17612)

This commit is contained in:
Sehoon Shon
2026-01-28 16:26:33 -05:00
committed by GitHub
parent 30065c51fb
commit bee1267e2a
15 changed files with 429 additions and 112 deletions

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { render } from '../../test-utils/render.js';
import { renderWithProviders } from '../../test-utils/render.js';
import { AboutBox } from './AboutBox.js';
import { describe, it, expect, vi } from 'vitest';
@@ -25,7 +25,7 @@ describe('AboutBox', () => {
};
it('renders with required props', () => {
const { lastFrame } = render(<AboutBox {...defaultProps} />);
const { lastFrame } = renderWithProviders(<AboutBox {...defaultProps} />);
const output = lastFrame();
expect(output).toContain('About Gemini CLI');
expect(output).toContain('1.0.0');
@@ -42,7 +42,7 @@ describe('AboutBox', () => {
['tier', 'Enterprise', 'Tier'],
])('renders optional prop %s', (prop, value, label) => {
const props = { ...defaultProps, [prop]: value };
const { lastFrame } = render(<AboutBox {...props} />);
const { lastFrame } = renderWithProviders(<AboutBox {...props} />);
const output = lastFrame();
expect(output).toContain(label);
expect(output).toContain(value);
@@ -50,14 +50,14 @@ describe('AboutBox', () => {
it('renders Auth Method with email when userEmail is provided', () => {
const props = { ...defaultProps, userEmail: 'test@example.com' };
const { lastFrame } = render(<AboutBox {...props} />);
const { lastFrame } = renderWithProviders(<AboutBox {...props} />);
const output = lastFrame();
expect(output).toContain('Logged in with Google (test@example.com)');
});
it('renders Auth Method correctly when not oauth', () => {
const props = { ...defaultProps, selectedAuthType: 'api-key' };
const { lastFrame } = render(<AboutBox {...props} />);
const { lastFrame } = renderWithProviders(<AboutBox {...props} />);
const output = lastFrame();
expect(output).toContain('api-key');
});