From fcff356a8b5bb158ce291880694f37abfc800aea Mon Sep 17 00:00:00 2001 From: jacob314 Date: Wed, 8 Apr 2026 16:51:28 -0700 Subject: [PATCH] test: add svg test for full-width input line in InputPrompt --- .../cli/src/ui/components/InputPrompt.test.tsx | 5 +++++ ...n-a-full-width-line-with-no-whitespa-.snap.svg | 15 +++++++++++++++ .../__snapshots__/InputPrompt.test.tsx.snap | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100644 packages/cli/src/ui/components/__snapshots__/InputPrompt-InputPrompt-Highlighting-and-Cursor-Display-single-line-scenarios-should-display-cursor-correctly-on-a-full-width-line-with-no-whitespa-.snap.svg diff --git a/packages/cli/src/ui/components/InputPrompt.test.tsx b/packages/cli/src/ui/components/InputPrompt.test.tsx index 7a241691e8..6a0a5f757e 100644 --- a/packages/cli/src/ui/components/InputPrompt.test.tsx +++ b/packages/cli/src/ui/components/InputPrompt.test.tsx @@ -2318,6 +2318,11 @@ describe('InputPrompt', () => { text: '', visualCursor: [0, 0], }, + { + name: 'on a full-width line with no whitespace', + text: 'x'.repeat(94), + visualCursor: [0, 94], + }, { name: 'on a space between words', text: 'hello world', diff --git a/packages/cli/src/ui/components/__snapshots__/InputPrompt-InputPrompt-Highlighting-and-Cursor-Display-single-line-scenarios-should-display-cursor-correctly-on-a-full-width-line-with-no-whitespa-.snap.svg b/packages/cli/src/ui/components/__snapshots__/InputPrompt-InputPrompt-Highlighting-and-Cursor-Display-single-line-scenarios-should-display-cursor-correctly-on-a-full-width-line-with-no-whitespa-.snap.svg new file mode 100644 index 0000000000..0e5159fc21 --- /dev/null +++ b/packages/cli/src/ui/components/__snapshots__/InputPrompt-InputPrompt-Highlighting-and-Cursor-Display-single-line-scenarios-should-display-cursor-correctly-on-a-full-width-line-with-no-whitespa-.snap.svg @@ -0,0 +1,15 @@ + + + + + ──────────────────────────────────────────────────────────────────────────────────────────────────── + + > + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + + + ──────────────────────────────────────────────────────────────────────────────────────────────────── + + \ No newline at end of file diff --git a/packages/cli/src/ui/components/__snapshots__/InputPrompt.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/InputPrompt.test.tsx.snap index ab6fe9b928..808135fb11 100644 --- a/packages/cli/src/ui/components/__snapshots__/InputPrompt.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/InputPrompt.test.tsx.snap @@ -72,6 +72,12 @@ exports[`InputPrompt > Highlighting and Cursor Display > single-line scenarios > ────────────────────────────────────────────────────────────────────────────────────────────────────" `; +exports[`InputPrompt > Highlighting and Cursor Display > single-line scenarios > should display cursor correctly 'on a full-width line with no whitespa…' 1`] = ` +"──────────────────────────────────────────────────────────────────────────────────────────────────── +│ > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx │ +────────────────────────────────────────────────────────────────────────────────────────────────────" +`; + exports[`InputPrompt > Highlighting and Cursor Display > single-line scenarios > should display cursor correctly 'on a highlighted token' 1`] = ` "──────────────────────────────────────────────────────────────────────────────────────────────────── │ > run @path/to/file │