fix: make chat honest about live replay status
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
import { act, cleanup, render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
||||
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("../connection/api.js", () => ({
|
||||
callOperation: vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
operation: "workflow.health",
|
||||
label: "Health",
|
||||
interpreted: { status: "ok" },
|
||||
exchange: { request: {}, response: {} },
|
||||
equivalentCli: "uv run wf status",
|
||||
durationMs: 2,
|
||||
}),
|
||||
}));
|
||||
|
||||
class MockResizeObserver {
|
||||
observe() {}
|
||||
@@ -56,7 +68,7 @@ describe("PresentationRoute", () => {
|
||||
setReplayMode();
|
||||
const { PresentationRoute } = await import("./PresentationRoute.js");
|
||||
render(<PresentationRoute />);
|
||||
expect(screen.getByText(/replay fallback is active/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/replay evidence is active/i)).toBeInTheDocument();
|
||||
expect(screen.queryByLabelText(/presentation scene rail/i)).not.toBeInTheDocument();
|
||||
expect(screen.getByLabelText("scene position")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -54,10 +54,10 @@ export const PresentationRoute = () => {
|
||||
const presentationTarget = useMemo(() => resolvePresentationTarget(), []);
|
||||
const demo = useDemoTimeline(presentationTarget.target, recordEvidence, recording);
|
||||
const targetStatus = usePresentationTargetStatus(presentationTarget, demo.state);
|
||||
const timelineAgent = useTimelineAgent(
|
||||
demo,
|
||||
presentationTarget.mode === "live" ? "live" : "replay",
|
||||
);
|
||||
const timelineAgent = useTimelineAgent(demo, {
|
||||
mode: presentationTarget.mode === "live" ? "live" : "replay",
|
||||
status: targetStatus,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const hash = hashForLocation(state.location);
|
||||
|
||||
Reference in New Issue
Block a user