test: pin defense qna branch navigation

This commit is contained in:
lda
2026-07-08 07:16:12 +07:00 Verified
parent 2c23619dd2
commit 32a2e2397d
2 changed files with 29 additions and 0 deletions
@@ -73,6 +73,29 @@ describe("SceneBody", () => {
expect(screen.getByLabelText(/workflow graph/i)).toBeInTheDocument();
});
it("opens thesis Q&A branches from the thesis scene", async () => {
const user = userEvent.setup();
const location: PresentationLocation = { kind: "main", sceneId: "thesis", beatId: "title", focusPath: [] };
const openDiscussion = vi.fn();
render(
<SceneBody
location={location}
demo={demo}
selectedNodeId={null}
selectNode={noop}
openEvidence={noop}
openDiscussion={openDiscussion}
onFocusPathChange={noop}
motionDisabled={false}
/>,
);
await user.click(screen.getByRole("button", { name: /where is the ai agent/i }));
expect(openDiscussion).toHaveBeenCalledWith("where-is-ai-agent");
});
it("opens a scene discussion branch from the scene body", async () => {
const user = userEvent.setup();
const location: PresentationLocation = { kind: "main", sceneId: "positioning", beatId: "landscape", focusPath: [] };
@@ -15,6 +15,12 @@ describe("storyboard navigation", () => {
kind: "discussion",
branchId: "hosted-automation",
});
expect(locationFromHash("#discuss/where-is-ai-agent")).toEqual({
kind: "discussion",
branchId: "where-is-ai-agent",
});
expect(hashForLocation({ kind: "discussion", branchId: "where-is-ai-agent" }))
.toBe("#discuss/where-is-ai-agent");
});
it("falls back for unknown scene, beat, and branch hashes", () => {