diff options
| author | Jacob Richman <[email protected]> | 2025-08-15 10:54:00 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-15 17:54:00 +0000 |
| commit | bd5e49c5ff0d0f5e03e5f42435de00c5a0758d7e (patch) | |
| tree | c55a474cd3630661ed42d63d8662b8266bdf11d0 /packages/cli/src/ui/components/FolderTrustDialog.test.tsx | |
| parent | 1a2906a8ad6e9cf7a68441c956af91d189eff417 (diff) | |
fix(input) Resolve cases where escape was broken (#6304)
Diffstat (limited to 'packages/cli/src/ui/components/FolderTrustDialog.test.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/FolderTrustDialog.test.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/cli/src/ui/components/FolderTrustDialog.test.tsx b/packages/cli/src/ui/components/FolderTrustDialog.test.tsx index d1be0b61..e2b695e2 100644 --- a/packages/cli/src/ui/components/FolderTrustDialog.test.tsx +++ b/packages/cli/src/ui/components/FolderTrustDialog.test.tsx @@ -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'); |
