From bd5e49c5ff0d0f5e03e5f42435de00c5a0758d7e Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Fri, 15 Aug 2025 10:54:00 -0700 Subject: fix(input) Resolve cases where escape was broken (#6304) --- .../components/shared/RadioButtonSelect.test.tsx | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx') diff --git a/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx b/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx index d4c13ba5..cb6db77f 100644 --- a/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx +++ b/packages/cli/src/ui/components/shared/RadioButtonSelect.test.tsx @@ -4,7 +4,7 @@ * 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 { RadioButtonSelect, @@ -20,21 +20,21 @@ const ITEMS: Array> = [ describe('', () => { it('renders a list of items and matches snapshot', () => { - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( {}} isFocused={true} />, ); expect(lastFrame()).toMatchSnapshot(); }); it('renders with the second item selected and matches snapshot', () => { - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( {}} />, ); expect(lastFrame()).toMatchSnapshot(); }); it('renders with numbers hidden and matches snapshot', () => { - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( {}} @@ -49,7 +49,7 @@ describe('', () => { label: `Item ${i + 1}`, value: `item-${i + 1}`, })); - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( {}} @@ -75,7 +75,7 @@ describe('', () => { themeTypeDisplay: '(Dark)', }, ]; - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( {}} />, ); expect(lastFrame()).toMatchSnapshot(); @@ -86,14 +86,14 @@ describe('', () => { label: `Item ${i + 1}`, value: `item-${i + 1}`, })); - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( {}} />, ); expect(lastFrame()).toMatchSnapshot(); }); it('renders nothing when no items are provided', () => { - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( {}} isFocused={true} />, ); expect(lastFrame()).toBe(''); @@ -103,7 +103,7 @@ describe('', () => { describe('keyboard navigation', () => { it('should call onSelect when "enter" is pressed', () => { const onSelect = vi.fn(); - const { stdin } = render( + const { stdin } = renderWithProviders( , ); @@ -115,7 +115,7 @@ describe('keyboard navigation', () => { describe('when isFocused is false', () => { it('should not handle any keyboard input', () => { const onSelect = vi.fn(); - const { stdin } = render( + const { stdin } = renderWithProviders( { ])('$description', ({ isFocused }) => { it('should navigate down with arrow key and select with enter', async () => { const onSelect = vi.fn(); - const { stdin, lastFrame } = render( + const { stdin, lastFrame } = renderWithProviders( { it('should navigate up with arrow key and select with enter', async () => { const onSelect = vi.fn(); - const { stdin, lastFrame } = render( + const { stdin, lastFrame } = renderWithProviders(