fix: hide presentation target status outside demo arc
This commit is contained in:
@@ -41,4 +41,28 @@ describe("PresentationFooter", () => {
|
|||||||
expect(within(footer).getByText("3 / 4")).toBeInTheDocument();
|
expect(within(footer).getByText("3 / 4")).toBeInTheDocument();
|
||||||
expect(within(footer).getByText(/workflow\.runs\.trace/)).toBeInTheDocument();
|
expect(within(footer).getByText(/workflow\.runs\.trace/)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("hides target status outside the demo arc", () => {
|
||||||
|
render(
|
||||||
|
<PresentationFooter
|
||||||
|
location={{
|
||||||
|
kind: "main",
|
||||||
|
sceneId: "conclusion",
|
||||||
|
beatId: "questions",
|
||||||
|
focusPath: [],
|
||||||
|
}}
|
||||||
|
evidence={[]}
|
||||||
|
targetStatus={{
|
||||||
|
kind: "replay",
|
||||||
|
label: "Replay evidence",
|
||||||
|
detail: "reviewed recording",
|
||||||
|
}}
|
||||||
|
showEvidenceReceipt={false}
|
||||||
|
inspectEvidence={vi.fn()}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
const footer = screen.getByRole("contentinfo", { name: /presentation footer/i });
|
||||||
|
expect(within(footer).queryByLabelText("presentation evidence mode")).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { SceneProgress } from "./SceneProgress.js";
|
|||||||
import { EvidenceReceipt } from "./evidence/EvidenceReceipt.js";
|
import { EvidenceReceipt } from "./evidence/EvidenceReceipt.js";
|
||||||
import { PresentationTruthBadge } from "./PresentationTruthBadge.js";
|
import { PresentationTruthBadge } from "./PresentationTruthBadge.js";
|
||||||
import type { PresentationTargetHealth } from "./presentation-target-status.js";
|
import type { PresentationTargetHealth } from "./presentation-target-status.js";
|
||||||
|
import { isDemoChromeScene } from "./presentation-demo-chrome.js";
|
||||||
import type { MainLocation } from "./storyboard.js";
|
import type { MainLocation } from "./storyboard.js";
|
||||||
|
|
||||||
type PresentationFooterProps = {
|
type PresentationFooterProps = {
|
||||||
@@ -22,7 +23,7 @@ export const PresentationFooter = ({
|
|||||||
}: PresentationFooterProps) => (
|
}: PresentationFooterProps) => (
|
||||||
<footer className="presentation-footer" aria-label="presentation footer">
|
<footer className="presentation-footer" aria-label="presentation footer">
|
||||||
<SceneProgress location={location} />
|
<SceneProgress location={location} />
|
||||||
<PresentationTruthBadge status={targetStatus} />
|
{isDemoChromeScene(location.sceneId) && <PresentationTruthBadge status={targetStatus} />}
|
||||||
<EvidenceReceipt
|
<EvidenceReceipt
|
||||||
records={evidence}
|
records={evidence}
|
||||||
visible={showEvidenceReceipt}
|
visible={showEvidenceReceipt}
|
||||||
|
|||||||
@@ -367,6 +367,16 @@ describe("PresentationRoute", () => {
|
|||||||
expect(mockedCallOperation).not.toHaveBeenCalledWith("workflow.health", expect.anything(), expect.anything());
|
expect(mockedCallOperation).not.toHaveBeenCalledWith("workflow.health", expect.anything(), expect.anything());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("hides target status on a non-demo route", async () => {
|
||||||
|
window.sessionStorage.setItem("lda.workflowConsole.target", "http://127.0.0.1:8765/rpc");
|
||||||
|
window.location.hash = "#scene/conclusion/questions";
|
||||||
|
const { PresentationRoute } = await import("./PresentationRoute.js");
|
||||||
|
render(<PresentationRoute />);
|
||||||
|
|
||||||
|
expect(await screen.findByRole("contentinfo", { name: /presentation footer/i })).toBeInTheDocument();
|
||||||
|
expect(screen.queryByLabelText("presentation evidence mode")).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
it("opens Scene 10 approval from the canonical hash", async () => {
|
it("opens Scene 10 approval from the canonical hash", async () => {
|
||||||
window.location.hash = "#scene/typed-human-boundary/approval";
|
window.location.hash = "#scene/typed-human-boundary/approval";
|
||||||
const { PresentationRoute } = await import("./PresentationRoute.js");
|
const { PresentationRoute } = await import("./PresentationRoute.js");
|
||||||
|
|||||||
Reference in New Issue
Block a user