tui: resolve default mini footer agent (#38315)
This commit is contained in:
parent
e12ec8681b
commit
5841b04fe7
2 changed files with 27 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { expect, test } from "bun:test"
|
||||
import { coalesceProgressCommit } from "../../src/mini/footer"
|
||||
import type { StreamCommit } from "../../src/mini/types"
|
||||
import { coalesceProgressCommit, resolveRunAgent } from "../../src/mini/footer"
|
||||
import type { RunAgent, StreamCommit } from "../../src/mini/types"
|
||||
|
||||
function progress(input: Partial<StreamCommit> = {}): StreamCommit {
|
||||
return {
|
||||
|
|
@ -23,3 +23,16 @@ test("coalesces progress only within the same message and tool state", () => {
|
|||
progress({ text: "onetwo", directory: "/latest" }),
|
||||
)
|
||||
})
|
||||
|
||||
test("resolves the first selectable agent when none is selected", () => {
|
||||
const agents: RunAgent[] = [
|
||||
{ id: "task", name: "Task", mode: "subagent", hidden: false },
|
||||
{ id: "secret", name: "Secret", mode: "primary", hidden: true },
|
||||
{ id: "build", name: "Build", mode: "primary", hidden: false },
|
||||
{ id: "plan", name: "Plan", mode: "primary", hidden: false },
|
||||
]
|
||||
|
||||
expect(resolveRunAgent(agents, undefined)?.id).toBe("build")
|
||||
expect(resolveRunAgent(agents, "plan")?.id).toBe("plan")
|
||||
expect(resolveRunAgent(agents, "missing")?.id).toBe("build")
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue