From 2e28bb90a00ad415d453a2ec868faa78679602f0 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Wed, 23 Jul 2025 15:39:22 -0700 Subject: Update diff colors (#4747) Co-authored-by: Jacob Richman --- .../ui/components/messages/DiffRenderer.test.tsx | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'packages/cli/src/ui/components/messages/DiffRenderer.test.tsx') diff --git a/packages/cli/src/ui/components/messages/DiffRenderer.test.tsx b/packages/cli/src/ui/components/messages/DiffRenderer.test.tsx index e299f2af..9629b94b 100644 --- a/packages/cli/src/ui/components/messages/DiffRenderer.test.tsx +++ b/packages/cli/src/ui/components/messages/DiffRenderer.test.tsx @@ -130,8 +130,8 @@ index 0000001..0000002 100644 ); const output = lastFrame(); const lines = output!.split('\n'); - expect(lines[0]).toBe('1 - old line'); - expect(lines[1]).toBe('1 + new line'); + expect(lines[0]).toBe('1 - old line'); + expect(lines[1]).toBe('1 + new line'); }); it('should handle diff with only header and no changes', () => { @@ -253,35 +253,35 @@ index 123..789 100644 { terminalWidth: 80, height: undefined, - expected: `1 console.log('first hunk'); -2 - const oldVar = 1; -2 + const newVar = 1; -3 console.log('end of first hunk'); + expected: ` 1 console.log('first hunk'); + 2 - const oldVar = 1; + 2 + const newVar = 1; + 3 console.log('end of first hunk'); ════════════════════════════════════════════════════════════════════════════════ -20 console.log('second hunk'); -21 - const anotherOld = 'test'; -21 + const anotherNew = 'test'; -22 console.log('end of second hunk');`, +20 console.log('second hunk'); +21 - const anotherOld = 'test'; +21 + const anotherNew = 'test'; +22 console.log('end of second hunk');`, }, { terminalWidth: 80, height: 6, expected: `... first 4 lines hidden ... ════════════════════════════════════════════════════════════════════════════════ -20 console.log('second hunk'); -21 - const anotherOld = 'test'; -21 + const anotherNew = 'test'; -22 console.log('end of second hunk');`, +20 console.log('second hunk'); +21 - const anotherOld = 'test'; +21 + const anotherNew = 'test'; +22 console.log('end of second hunk');`, }, { terminalWidth: 30, height: 6, expected: `... first 10 lines hidden ... - 'test'; -21 + const anotherNew = - 'test'; -22 console.log('end of - second hunk');`, + ; +21 + const anotherNew = 'test' + ; +22 console.log('end of + second hunk');`, }, ])( 'with terminalWidth $terminalWidth and height $height', @@ -329,11 +329,11 @@ fileDiff Index: file.txt ); const output = lastFrame(); - expect(output).toEqual(`1 - const oldVar = 1; -1 + const newVar = 1; + expect(output).toEqual(` 1 - const oldVar = 1; + 1 + const newVar = 1; ════════════════════════════════════════════════════════════════════════════════ -20 - const anotherOld = 'test'; -20 + const anotherNew = 'test';`); +20 - const anotherOld = 'test'; +20 + const anotherNew = 'test';`); }); it('should correctly render a new file with no file extension correctly', () => { -- cgit v1.2.3