Add hidden property to slash commands (#7797)

This commit is contained in:
DeWitt Clinton
2025-09-05 13:38:36 -07:00
committed by GitHub
parent 0e284457be
commit c1b8708ef5
8 changed files with 70 additions and 22 deletions

View File

@@ -220,6 +220,18 @@ describe('useSlashCommandProcessor', () => {
expect(fileAction).toHaveBeenCalledTimes(1);
expect(builtinAction).not.toHaveBeenCalled();
});
it('should not include hidden commands in the command list', async () => {
const visibleCommand = createTestCommand({ name: 'visible' });
const hiddenCommand = createTestCommand({ name: 'hidden', hidden: true });
const result = setupProcessorHook([visibleCommand, hiddenCommand]);
await waitFor(() => {
expect(result.current.slashCommands).toHaveLength(1);
});
expect(result.current.slashCommands[0].name).toBe('visible');
});
});
describe('Command Execution Logic', () => {