diff options
| author | Ali Al Jufairi <[email protected]> | 2025-08-10 09:04:52 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-10 00:04:52 +0000 |
| commit | 8a9a9275440e3681e9be73d741a5aba429ae501f (patch) | |
| tree | cc2c17101c57d0c34049a6ee390d0f1b9bf38018 /packages/cli/src/ui/commands/settingsCommand.test.ts | |
| parent | c632ec8b03ac5b459da9ccb041b9fca19252f69b (diff) | |
feat(ui): add /settings command and UI panel (#4738)
Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/commands/settingsCommand.test.ts')
| -rw-r--r-- | packages/cli/src/ui/commands/settingsCommand.test.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/cli/src/ui/commands/settingsCommand.test.ts b/packages/cli/src/ui/commands/settingsCommand.test.ts new file mode 100644 index 00000000..96d0d511 --- /dev/null +++ b/packages/cli/src/ui/commands/settingsCommand.test.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { describe, it, expect, beforeEach } from 'vitest'; +import { settingsCommand } from './settingsCommand.js'; +import { type CommandContext } from './types.js'; +import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; + +describe('settingsCommand', () => { + let mockContext: CommandContext; + + beforeEach(() => { + mockContext = createMockCommandContext(); + }); + + it('should return a dialog action to open the settings dialog', () => { + if (!settingsCommand.action) { + throw new Error('The settings command must have an action.'); + } + const result = settingsCommand.action(mockContext, ''); + expect(result).toEqual({ + type: 'dialog', + dialog: 'settings', + }); + }); + + it('should have the correct name and description', () => { + expect(settingsCommand.name).toBe('settings'); + expect(settingsCommand.description).toBe( + 'View and edit Gemini CLI settings', + ); + }); +}); |
