mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-12 04:17:15 -07:00
test(cli): stabilize useSelectionList tests and update CI
This commit is contained in:
@@ -4,18 +4,16 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
|
||||
import { act } from 'react';
|
||||
|
||||
vi.mock('./useKeypress.js');
|
||||
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import { waitFor } from '../../test-utils/async.js';
|
||||
import {
|
||||
useSelectionList,
|
||||
type SelectionListItem,
|
||||
} from './useSelectionList.js';
|
||||
import { useKeypress } from './useKeypress.js';
|
||||
import * as useKeypressModule from './useKeypress.js';
|
||||
|
||||
import type { KeypressHandler, Key } from '../contexts/KeypressContext.js';
|
||||
|
||||
@@ -23,7 +21,7 @@ type UseKeypressMockOptions = { isActive: boolean };
|
||||
|
||||
let activeKeypressHandler: KeypressHandler | null = null;
|
||||
|
||||
describe.skip('useSelectionList', () => {
|
||||
describe('useSelectionList', () => {
|
||||
const mockOnSelect = vi.fn();
|
||||
const mockOnHighlight = vi.fn();
|
||||
|
||||
@@ -36,7 +34,7 @@ describe.skip('useSelectionList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
activeKeypressHandler = null;
|
||||
vi.mocked(useKeypress).mockImplementation(
|
||||
vi.spyOn(useKeypressModule, 'useKeypress').mockImplementation(
|
||||
(handler: KeypressHandler, options?: UseKeypressMockOptions) => {
|
||||
if (options?.isActive) {
|
||||
activeKeypressHandler = handler;
|
||||
|
||||
Reference in New Issue
Block a user