mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
feat(hooks): add support for friendly names and descriptions (#15174)
This commit is contained in:
@@ -309,6 +309,24 @@ describe('hooksCommand', () => {
|
||||
content: 'Failed to enable hook: Failed to save settings',
|
||||
});
|
||||
});
|
||||
|
||||
it('should complete hook names using friendly names', () => {
|
||||
const enableCmd = hooksCommand.subCommands!.find(
|
||||
(cmd) => cmd.name === 'enable',
|
||||
)!;
|
||||
|
||||
const hookEntry = createMockHook(
|
||||
'./hooks/test.sh',
|
||||
HookEventName.BeforeTool,
|
||||
true,
|
||||
);
|
||||
hookEntry.config.name = 'friendly-name';
|
||||
|
||||
mockHookSystem.getAllHooks.mockReturnValue([hookEntry]);
|
||||
|
||||
const completions = enableCmd.completion!(mockContext, 'frie');
|
||||
expect(completions).toContain('friendly-name');
|
||||
});
|
||||
});
|
||||
|
||||
describe('disable subcommand', () => {
|
||||
|
||||
Reference in New Issue
Block a user