summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
diff options
context:
space:
mode:
authorPyush Sinha <[email protected]>2025-08-04 09:53:50 -0700
committerGitHub <[email protected]>2025-08-04 16:53:50 +0000
commite506b40c271da0e05a361f5299c37976a9e1f1f3 (patch)
tree2d569bd9a86734778f89e0197716e1b5db2954aa /packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
parent83a04c47552c1407662a5e3e567f4c5e50bba5de (diff)
fix: /help remove flickering and respect clear shortcut (ctr+l) (#3611)
Co-authored-by: Jacob Richman <[email protected]> Co-authored-by: Allen Hutchison <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.test.ts')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.test.ts21
1 files changed, 10 insertions, 11 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
index d9fe8530..a37af262 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
@@ -90,7 +90,7 @@ describe('useSlashCommandProcessor', () => {
const mockAddItem = vi.fn();
const mockClearItems = vi.fn();
const mockLoadHistory = vi.fn();
- const mockSetShowHelp = vi.fn();
+ const mockOpenThemeDialog = vi.fn();
const mockOpenAuthDialog = vi.fn();
const mockSetQuittingMessages = vi.fn();
@@ -132,9 +132,8 @@ describe('useSlashCommandProcessor', () => {
mockClearItems,
mockLoadHistory,
vi.fn(), // refreshStatic
- mockSetShowHelp,
vi.fn(), // onDebugMessage
- vi.fn(), // openThemeDialog
+ mockOpenThemeDialog, // openThemeDialog
mockOpenAuthDialog,
vi.fn(), // openEditorDialog
vi.fn(), // toggleCorgiMode
@@ -334,19 +333,19 @@ describe('useSlashCommandProcessor', () => {
});
describe('Action Result Handling', () => {
- it('should handle "dialog: help" action', async () => {
+ it('should handle "dialog: theme" action', async () => {
const command = createTestCommand({
- name: 'helpcmd',
- action: vi.fn().mockResolvedValue({ type: 'dialog', dialog: 'help' }),
+ name: 'themecmd',
+ action: vi.fn().mockResolvedValue({ type: 'dialog', dialog: 'theme' }),
});
const result = setupProcessorHook([command]);
await waitFor(() => expect(result.current.slashCommands).toHaveLength(1));
await act(async () => {
- await result.current.handleSlashCommand('/helpcmd');
+ await result.current.handleSlashCommand('/themecmd');
});
- expect(mockSetShowHelp).toHaveBeenCalledWith(true);
+ expect(mockOpenThemeDialog).toHaveBeenCalled();
});
it('should handle "load_history" action', async () => {
@@ -819,15 +818,15 @@ describe('useSlashCommandProcessor', () => {
mockClearItems,
mockLoadHistory,
vi.fn(), // refreshStatic
- mockSetShowHelp,
vi.fn(), // onDebugMessage
vi.fn(), // openThemeDialog
mockOpenAuthDialog,
- vi.fn(), // openEditorDialog,
+ vi.fn(), // openEditorDialog
vi.fn(), // toggleCorgiMode
mockSetQuittingMessages,
vi.fn(), // openPrivacyNotice
- vi.fn(), // toggleVimEnabled
+ vi.fn().mockResolvedValue(false), // toggleVimEnabled
+ vi.fn(), // setIsProcessing
),
);