Skip to content

Commit c402165

Browse files
test(session-ui): update chunk split test for label heuristic
The label heuristic (<40 chars ending ':') now keeps 'Steps:' glued to the list that follows it. Update the expected output to reflect the new intentional behavior (issue #628).
1 parent 138e921 commit c402165

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/session-ui/src/components/message-part.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ describe("splitSettledChunks", () => {
5959
test("splits before a list's first item, never between its items", () => {
6060
const text = "Steps:\n\n1. one\n\n2. two\n\n> quoted\n\nNext paragraph beg"
6161
const { chunks, tail } = splitSettledChunks(text)
62-
expect(chunks).toEqual(["Steps:\n\n", "1. one\n\n2. two\n\n> quoted\n\n"])
62+
// "Steps:" is a short label (<40 chars ending `:`) — stays glued to the
63+
// list that follows (issue #628 label heuristic). The list items and quote
64+
// then stay together via the CONTINUATION guard.
65+
expect(chunks).toEqual(["Steps:\n\n1. one\n\n2. two\n\n> quoted\n\n"])
6366
expect(tail).toBe("Next paragraph beg")
6467
})
6568

0 commit comments

Comments
 (0)