mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
Sync upstream Gemini-CLI v0.8.2 (#838)
This commit is contained in:
parent
096fabb5d6
commit
eb95c131be
644 changed files with 70389 additions and 23709 deletions
42
packages/cli/src/ui/hooks/useModelCommand.test.ts
Normal file
42
packages/cli/src/ui/hooks/useModelCommand.test.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* @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);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue