fix: harden presentation replay state
This commit is contained in:
@@ -83,4 +83,16 @@ describe("PreparedAuthoringLifecycleScene", () => {
|
||||
expect(active).toBeInTheDocument();
|
||||
expect(active).toHaveTextContent("Deployment");
|
||||
});
|
||||
|
||||
it("falls back to discovery for an unexpected storyboard beat", () => {
|
||||
const scene = findScene("prepared-lifecycle")!;
|
||||
const knownBeat = findBeat("prepared-lifecycle", "discover")!;
|
||||
const unexpectedBeat = { ...knownBeat, id: "unexpected" };
|
||||
|
||||
render(<PreparedAuthoringLifecycleScene scene={scene} beat={unexpectedBeat} />);
|
||||
|
||||
expect(screen.getByRole("region", { name: "discovery evidence" })).toBeInTheDocument();
|
||||
expect(screen.getByLabelText("authoring phase rail").querySelector("[data-active='true']"))
|
||||
.toHaveTextContent("Discover");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -26,7 +26,9 @@ const phases: readonly { readonly id: AuthoringPhaseId; readonly label: string }
|
||||
* remains below the canvas as a beat-synchronized assistant dock.
|
||||
*/
|
||||
export const PreparedAuthoringLifecycleScene = ({ scene, beat }: PreparedAuthoringLifecycleSceneProps) => {
|
||||
const beatId = beat.id as AuthoringPhaseId;
|
||||
// Storyboard beats normally match these IDs. Discovery is a safe projection
|
||||
// if a future beat reaches this scene before its authoring mapping is added.
|
||||
const beatId = phases.find((phase) => phase.id === beat.id)?.id ?? "discover";
|
||||
const projection = projectPreparedAuthoringPhase(beatId);
|
||||
|
||||
return (
|
||||
|
||||
@@ -49,8 +49,10 @@ describe("projectPreparedAuthoringPhase", () => {
|
||||
const diagnosticCmd = phase.commands.find(
|
||||
(cmd) => cmd.result === "diagnostic" && cmd.detail?.includes("no state projection"),
|
||||
);
|
||||
const repairCmd = phase.commands.find((cmd) => cmd.command.includes("draft set-output"));
|
||||
expect(diagnosticCmd).toBeDefined();
|
||||
expect(phase.commands.some((cmd) => cmd.command.includes("draft set-output"))).toBe(true);
|
||||
expect(repairCmd).toBeDefined();
|
||||
expect(diagnosticCmd).not.toBe(repairCmd);
|
||||
});
|
||||
|
||||
it("uses real public command syntax from the recording", () => {
|
||||
|
||||
Reference in New Issue
Block a user