Files
nanobot/tui/src/menus/branch-menu.test.ts
T
chengyongru f18423800e refactor(tui): organize source by feature boundaries (#5975)
* refactor(tui): group source files by feature

* refactor(tui): split app and gateway responsibilities
2026-09-29 16:57:36 +08:00

16 lines
543 B
TypeScript

import { expect, test } from "bun:test"
import { branchPoints } from "./branch-menu"
test("branch points preserve absolute user indices from paginated history", () => {
expect(branchPoints([
{ role: "user", content: "question" },
{ role: "assistant", content: " first\nreply ", forkIndex: 11 },
{ role: "activity", content: "read_file" },
{ role: "assistant", content: "second", forkIndex: 12 },
])).toEqual([
{ beforeUserIndex: 11, preview: "first reply" },
{ beforeUserIndex: 12, preview: "second" },
])
})