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