mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-11 13:51:10 -07:00
Allow for slash commands to opt-out of autocompletion and /help discovery. (#7847)
This commit is contained in:
@@ -347,6 +347,31 @@ describe('useSlashCompletion', () => {
|
||||
|
||||
expect(result.current.suggestions).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should not suggest hidden commands', async () => {
|
||||
const slashCommands = [
|
||||
createTestCommand({
|
||||
name: 'visible',
|
||||
description: 'A visible command',
|
||||
}),
|
||||
createTestCommand({
|
||||
name: 'hidden',
|
||||
description: 'A hidden command',
|
||||
hidden: true,
|
||||
}),
|
||||
];
|
||||
const { result } = renderHook(() =>
|
||||
useTestHarnessForSlashCompletion(
|
||||
true,
|
||||
'/',
|
||||
slashCommands,
|
||||
mockCommandContext,
|
||||
),
|
||||
);
|
||||
|
||||
expect(result.current.suggestions.length).toBe(1);
|
||||
expect(result.current.suggestions[0].label).toBe('visible');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Sub-Commands', () => {
|
||||
|
||||
Reference in New Issue
Block a user