mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-19 07:46:45 -07:00
53fab4a278
Co-authored-by: Miguel Solorio <miguel.solorio07@gmail.com>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { describe, it, expect } from 'vitest';
|
|
import { renderHook, act } from '@testing-library/react';
|
|
import { useModelCommand } from './useModelCommand.js';
|
|
|
|
describe('useModelCommand', () => {
|
|
it('should initialize with the model dialog closed', () => {
|
|
const { result } = renderHook(() => useModelCommand());
|
|
expect(result.current.isModelDialogOpen).toBe(false);
|
|
});
|
|
|
|
it('should open the model dialog when openModelDialog is called', () => {
|
|
const { result } = renderHook(() => useModelCommand());
|
|
|
|
act(() => {
|
|
result.current.openModelDialog();
|
|
});
|
|
|
|
expect(result.current.isModelDialogOpen).toBe(true);
|
|
});
|
|
|
|
it('should close the model dialog when closeModelDialog is called', () => {
|
|
const { result } = renderHook(() => useModelCommand());
|
|
|
|
// Open it first
|
|
act(() => {
|
|
result.current.openModelDialog();
|
|
});
|
|
expect(result.current.isModelDialogOpen).toBe(true);
|
|
|
|
// Then close it
|
|
act(() => {
|
|
result.current.closeModelDialog();
|
|
});
|
|
expect(result.current.isModelDialogOpen).toBe(false);
|
|
});
|
|
});
|