mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
fix(input) Resolve cases where escape was broken (#6304)
This commit is contained in:
parent
1a2906a8ad
commit
bd5e49c5ff
14 changed files with 697 additions and 582 deletions
|
|
@ -4,14 +4,16 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { render } from 'ink-testing-library';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { vi } from 'vitest';
|
||||
import { FolderTrustDialog, FolderTrustChoice } from './FolderTrustDialog.js';
|
||||
|
||||
describe('FolderTrustDialog', () => {
|
||||
it('should render the dialog with title and description', () => {
|
||||
const { lastFrame } = render(<FolderTrustDialog onSelect={vi.fn()} />);
|
||||
const { lastFrame } = renderWithProviders(
|
||||
<FolderTrustDialog onSelect={vi.fn()} />,
|
||||
);
|
||||
|
||||
expect(lastFrame()).toContain('Do you trust this folder?');
|
||||
expect(lastFrame()).toContain(
|
||||
|
|
@ -21,7 +23,9 @@ describe('FolderTrustDialog', () => {
|
|||
|
||||
it('should call onSelect with DO_NOT_TRUST when escape is pressed', async () => {
|
||||
const onSelect = vi.fn();
|
||||
const { stdin } = render(<FolderTrustDialog onSelect={onSelect} />);
|
||||
const { stdin } = renderWithProviders(
|
||||
<FolderTrustDialog onSelect={onSelect} />,
|
||||
);
|
||||
|
||||
stdin.write('\x1b');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue