feat: connect prepared run and refine presenter notes

This commit is contained in:
lda
2026-07-14 08:59:32 +07:00 Verified
parent 5ba9e55f92
commit 184e41858c
26 changed files with 296 additions and 114 deletions
@@ -7,7 +7,12 @@ import { PreparedAuthoringLifecycleScene } from "./PreparedAuthoringLifecycleSce
afterEach(() => cleanup());
const renderBeat = (beatId: string, onAdvance?: () => void, discussionRail?: ReactNode) => {
const renderBeat = (
beatId: string,
onAdvance?: () => void,
discussionRail?: ReactNode,
onRunPreparedWorkflow?: () => Promise<void>,
) => {
const scene = findScene("prepared-lifecycle");
const beat = findBeat("prepared-lifecycle", beatId);
if (!scene || !beat) throw new Error(`missing prepared-lifecycle/${beatId}`);
@@ -16,6 +21,7 @@ const renderBeat = (beatId: string, onAdvance?: () => void, discussionRail?: Rea
scene={scene}
beat={beat}
onAdvance={onAdvance}
onRunPreparedWorkflow={onRunPreparedWorkflow}
discussionRail={discussionRail}
/>,
);
@@ -173,6 +179,21 @@ describe("PreparedAuthoringLifecycleScene", () => {
expect(onAdvance).toHaveBeenCalledTimes(advances ? 1 : 0);
});
it("answers the terminal run request without advancing the presentation", async () => {
const user = userEvent.setup();
const onAdvance = vi.fn();
const onRunPreparedWorkflow = vi.fn().mockResolvedValue(undefined);
renderBeat("deployment", onAdvance, undefined, onRunPreparedWorkflow);
await user.click(screen.getByRole("button", { name: /send message/i }));
expect(screen.getByRole("textbox", { name: /message to authoring assistant/i })).toHaveValue("");
expect(screen.getByRole("button", { name: /run.*1 tool call/i })).toBeInTheDocument();
expect(screen.getByText(/three proposed issues are ready for review/i)).toBeInTheDocument();
expect(onRunPreparedWorkflow).toHaveBeenCalledOnce();
expect(onAdvance).not.toHaveBeenCalled();
});
it.each([
["discover", "Discover"],
["draft", "Draft"],