The first public release of LLeMbas CLI: a terminal coding agent and project manager for any LLM API, with permission modes, git snapshots, memory and skills, knowledge bases, MCP, voice, and a link to a LLeMbas instance whose web UI can work its sessions too. Signed Linux binaries for x64 and arm64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
355 files changed
+47028
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { afterEach, expect, test } from "bun:test"
|
||||
import { testRender } from "@opentui/solid"
|
||||
import { createSignal, Show } from "solid-js"
|
||||
import type { DialogSpec } from "../../src/tui/components/dialog.tsx"
|
||||
import { Dialog } from "../../src/tui/components/dialog.tsx"
|
||||
import { TuiContext } from "../../src/tui/context.ts"
|
||||
import { DEFAULT_THEME } from "../../src/tui/theme.ts"
|
||||
|
||||
let setup: Awaited<ReturnType<typeof testRender>> | undefined
|
||||
afterEach(() => setup?.renderer.destroy())
|
||||
|
||||
test("dialog: arrow down + enter picks the second option — with a spec that closing clears, as in the app", async () => {
|
||||
const picked: string[] = []
|
||||
let closed = 0
|
||||
const ctx = { theme: () => DEFAULT_THEME, dims: () => ({ width: 60, height: 16 }) } as never
|
||||
const [spec, setSpec] = createSignal<DialogSpec | undefined>({
|
||||
title: "Model",
|
||||
options: [{ label: "a", value: "a", current: true }, { label: "b", value: "b" }],
|
||||
onSelect: (v) => picked.push(v),
|
||||
})
|
||||
setup = await testRender(
|
||||
() => (
|
||||
<TuiContext.Provider value={ctx}>
|
||||
<Show when={spec()}>
|
||||
<Dialog spec={spec()!} close={() => (closed++, setSpec(undefined))} />
|
||||
</Show>
|
||||
</TuiContext.Provider>
|
||||
),
|
||||
{ width: 60, height: 16 },
|
||||
)
|
||||
await setup.renderOnce()
|
||||
setup.mockInput.pressArrow("down")
|
||||
await setup.renderOnce()
|
||||
setup.mockInput.pressEnter()
|
||||
await setup.renderOnce()
|
||||
expect(picked).toEqual(["b"])
|
||||
expect(closed).toBe(1)
|
||||
})
|
||||
Reference in new issue
Block a user