fix: align wrap mode with Ink (trim: false)

Ink's wrap mode uses { trim: false } to preserve leading/trailing
whitespace on wrapped lines. We incorrectly used trim: true which
stripped whitespace. Updates unit test and inline snapshots.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yunfei He
2026-05-25 23:14:17 +08:00
parent 630ee8488a
commit 07cfe5d6fb
3 changed files with 11 additions and 11 deletions
@@ -115,8 +115,8 @@ test("Multiple Text elements inherit same background", async () => {
{ columns: 100 },
);
expect(lastFrame()).toMatchInlineSnapshot(`
"Hello
World"
"Hello 
World "
`);
});
@@ -132,9 +132,9 @@ test("Mixed text with and without background inheritance", async () => {
{ columns: 100 },
);
expect(lastFrame()).toMatchInlineSnapshot(`
"Inherited
No BG 
Red BG "
"Inherited 
No BG 
Red BG "
`);
});
@@ -154,8 +154,8 @@ test("Complex nested structure with background inheritance", async () => {
{ columns: 100 },
);
expect(lastFrame()).toMatchInlineSnapshot(`
"Outer: 
Inner: 
"Outer:  
Inner:  
Explicit"
`);
});
@@ -422,7 +422,7 @@ test("Box backgroundColor fills full width on every line when text wraps", async
{ columns: 100 },
);
expect(lastFrame()).toMatchInlineSnapshot(`
"Hello 
"Hello  
World!! "
`);
});
@@ -437,7 +437,7 @@ test("Text-only backgroundColor colors text content but does not fill Box width"
{ columns: 100 },
);
expect(lastFrame()).toMatchInlineSnapshot(`
"Hello
"Hello 
World!!"
`);
});