mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-04 10:11:46 +03:00
feat(tui): make follow-up queue explicit
This commit is contained in:
@@ -5,13 +5,13 @@ import { PromptQueue } from "./prompt-queue"
|
||||
const prompt = (content: string) => ({ content, options: {} })
|
||||
|
||||
describe("PromptQueue", () => {
|
||||
test("promotes the newest armed prompt to steering", () => {
|
||||
test("returns the latest follow-up for editing", () => {
|
||||
const queue = new PromptQueue()
|
||||
queue.enqueue(prompt("next one"))
|
||||
queue.enqueue(prompt("steer now"))
|
||||
|
||||
expect(queue.takeSteering()?.content).toBe("steer now")
|
||||
expect(queue.takeSteering()).toBeNull()
|
||||
expect(queue.takeLast()?.content).toBe("steer now")
|
||||
expect(queue.snapshot().map(({ content }) => content)).toEqual(["next one"])
|
||||
expect(queue.takeFollowUp()?.content).toBe("next one")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user