mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 02:54:31 -07:00
Add ExtensionDetails dialog and support install (#20845)
This commit is contained in:
@@ -206,4 +206,34 @@ describe('ExtensionRegistryView', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should call onSelect when extension is selected and Enter is pressed in details', async () => {
|
||||
const { stdin, lastFrame } = renderView();
|
||||
|
||||
// Select the first extension in the list (Enter opens details)
|
||||
await React.act(async () => {
|
||||
stdin.write('\r');
|
||||
});
|
||||
|
||||
// Verify we are in details view
|
||||
await waitFor(() => {
|
||||
expect(lastFrame()).toContain('author/ext1');
|
||||
expect(lastFrame()).toContain('[Enter] Install');
|
||||
});
|
||||
|
||||
// Ensure onSelect hasn't been called yet
|
||||
expect(mockOnSelect).not.toHaveBeenCalled();
|
||||
|
||||
// Press Enter again in the details view to trigger install
|
||||
await React.act(async () => {
|
||||
stdin.write('\r');
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockOnSelect).toHaveBeenCalledWith(
|
||||
mockExtensions[0],
|
||||
expect.any(Function),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user