mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-20 18:14:29 -07:00
refactor(cli): simplify keypress and mouse providers and update tests (#22853)
This commit is contained in:
committed by
GitHub
parent
81a97e78f1
commit
d7dfcf7f99
@@ -4,12 +4,11 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { render } from '../../test-utils/render.js';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { useFocus } from './useFocus.js';
|
||||
import { vi, type Mock } from 'vitest';
|
||||
import { useStdin, useStdout } from 'ink';
|
||||
import { KeypressProvider } from '../contexts/KeypressContext.js';
|
||||
import { act } from 'react';
|
||||
|
||||
// Mock the ink hooks
|
||||
@@ -54,11 +53,7 @@ describe('useFocus', () => {
|
||||
hookResult = useFocus();
|
||||
return null;
|
||||
}
|
||||
const { unmount } = render(
|
||||
<KeypressProvider>
|
||||
<TestComponent />
|
||||
</KeypressProvider>,
|
||||
);
|
||||
const { unmount } = renderWithProviders(<TestComponent />);
|
||||
return {
|
||||
result: {
|
||||
get current() {
|
||||
|
||||
Reference in New Issue
Block a user