(
builtinCommands: SlashCommand[] = [],
fileCommands: SlashCommand[] = [],
mcpCommands: SlashCommand[] = [],
setIsProcessing = vi.fn(),
)
| 120 | }); |
| 121 | |
| 122 | const setupProcessorHook = ( |
| 123 | builtinCommands: SlashCommand[] = [], |
| 124 | fileCommands: SlashCommand[] = [], |
| 125 | mcpCommands: SlashCommand[] = [], |
| 126 | setIsProcessing = vi.fn(), |
| 127 | ) => { |
| 128 | mockBuiltinLoadCommands.mockResolvedValue(Object.freeze(builtinCommands)); |
| 129 | mockFileLoadCommands.mockResolvedValue(Object.freeze(fileCommands)); |
| 130 | mockMcpLoadCommands.mockResolvedValue(Object.freeze(mcpCommands)); |
| 131 | |
| 132 | const { result } = renderHook(() => |
| 133 | useSlashCommandProcessor( |
| 134 | mockConfig, |
| 135 | mockSettings, |
| 136 | mockAddItem, |
| 137 | mockClearItems, |
| 138 | mockLoadHistory, |
| 139 | vi.fn(), // refreshStatic |
| 140 | vi.fn(), // onDebugMessage |
| 141 | mockOpenThemeDialog, // openThemeDialog |
| 142 | mockOpenAuthDialog, |
| 143 | vi.fn(), // openEditorDialog |
| 144 | vi.fn(), // toggleCorgiMode |
| 145 | mockSetQuittingMessages, |
| 146 | vi.fn(), // openPrivacyNotice |
| 147 | vi.fn(), // openSettingsDialog |
| 148 | vi.fn(), // toggleVimEnabled |
| 149 | setIsProcessing, |
| 150 | ), |
| 151 | ); |
| 152 | |
| 153 | return result; |
| 154 | }; |
| 155 | |
| 156 | describe('Initialization and Command Loading', () => { |
| 157 | it('should initialize CommandService with all required loaders', () => { |
no test coverage detected