mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 01:51:20 -07:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import {
|
|
renderWithProviders,
|
|
createMockSettings,
|
|
} from '../../test-utils/render.js';
|
|
import { CliSpinner } from './CliSpinner.js';
|
|
import { debugState } from '../debug.js';
|
|
import { describe, it, expect, beforeEach } from 'vitest';
|
|
|
|
describe('<CliSpinner />', () => {
|
|
beforeEach(() => {
|
|
debugState.debugNumAnimatedComponents = 0;
|
|
});
|
|
|
|
it('should increment debugNumAnimatedComponents on mount and decrement on unmount', () => {
|
|
expect(debugState.debugNumAnimatedComponents).toBe(0);
|
|
const { unmount } = renderWithProviders(<CliSpinner />);
|
|
expect(debugState.debugNumAnimatedComponents).toBe(1);
|
|
unmount();
|
|
expect(debugState.debugNumAnimatedComponents).toBe(0);
|
|
});
|
|
|
|
it('should not render when showSpinner is false', () => {
|
|
const settings = createMockSettings({ ui: { showSpinner: false } });
|
|
const { lastFrame } = renderWithProviders(<CliSpinner />, { settings });
|
|
expect(lastFrame()).toBe('');
|
|
});
|
|
});
|