spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / tests / views / layout / wrapped-lines.test.ts
29 lines · 791 BRaw
1import { describe, expect, test, tier } from 'claude-code/testing'
2
3import Views from '../../../hooks/views'
4import Fixtures from '../../fixtures'
5
6tier('builtin')
7
8describe('wrapped-lines', () => {
9 test('each line cut as Ink cuts it for the built-in', () => {
10 for (const [text, byWidth] of Object.entries(Fixtures.BUILTIN_WRAPS)) {
11 for (const [width, builtin] of Object.entries(byWidth)) {
12 expect(
13 Views.wrappedLines(text, Number(width)),
14 `${width}: ${text}`,
15 ).toEqual(builtin)
16 }
17 }
18
19 expect(
20 Views.wrappedLines(
21 "Couldn't read the git diff — it will retry on the next change",
22 48,
23 ),
24 ).toEqual([
25 "Couldn't read the git diff — it will retry on ",
26 'the next change',
27 ])
28 })
29})