docs: move nodeuse to optional defense deep dive
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import rehearsalRoutes from "../../../../../scripts/presentation-rehearsal-routes.json";
|
||||
import {
|
||||
hashForLocation,
|
||||
locationFromHash,
|
||||
@@ -24,28 +23,9 @@ describe("storyboard navigation", () => {
|
||||
.toBe("#discuss/where-is-ai-agent");
|
||||
});
|
||||
|
||||
it("covers every current storyboard beat with one canonical rehearsal route", () => {
|
||||
const storyboardRoutes = mainScenes.flatMap((scene) =>
|
||||
scene.beats.map((beat) => `${scene.id}/${beat.id}`),
|
||||
);
|
||||
const manifestRoutes = rehearsalRoutes.map((route) => `${route.sceneId}/${route.beatId}`);
|
||||
|
||||
expect(new Set(manifestRoutes).size).toBe(manifestRoutes.length);
|
||||
expect(manifestRoutes).toHaveLength(storyboardRoutes.length);
|
||||
|
||||
it("round-trips every current storyboard beat", () => {
|
||||
for (const scene of mainScenes) {
|
||||
for (const beat of scene.beats) {
|
||||
const matchingRoutes = rehearsalRoutes.filter(
|
||||
(route) => route.sceneId === scene.id && route.beatId === beat.id,
|
||||
);
|
||||
expect(matchingRoutes, `missing rehearsal route for scene ${scene.id}`).toHaveLength(1);
|
||||
const route = matchingRoutes[0];
|
||||
if (!route) continue;
|
||||
expect(route).toMatchObject({
|
||||
sceneId: scene.id,
|
||||
beatId: beat.id,
|
||||
route: `${scene.id}/${beat.id}`,
|
||||
});
|
||||
expect(locationFromHash(hashForLocation({
|
||||
kind: "main",
|
||||
sceneId: scene.id,
|
||||
@@ -60,21 +40,6 @@ describe("storyboard navigation", () => {
|
||||
}
|
||||
}
|
||||
|
||||
for (const route of rehearsalRoutes) {
|
||||
expect(Object.keys(route).sort()).toEqual(["beatId", "fileStem", "route", "sceneId"]);
|
||||
expect(storyboardRoutes).toContain(`${route.sceneId}/${route.beatId}`);
|
||||
expect(locationFromHash(hashForLocation({
|
||||
kind: "main",
|
||||
sceneId: route.sceneId as MainLocation["sceneId"],
|
||||
beatId: route.beatId,
|
||||
focusPath: [],
|
||||
}))).toMatchObject({
|
||||
kind: "main",
|
||||
sceneId: route.sceneId,
|
||||
beatId: route.beatId,
|
||||
focusPath: [],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it("parses the Questions beat location", () => {
|
||||
@@ -118,9 +83,20 @@ describe("storyboard navigation", () => {
|
||||
expect(locationFromHash("#scene/architecture/runtime")).toMatchObject({
|
||||
focusPath: ["runtime-providers"],
|
||||
});
|
||||
expect(locationFromHash("#scene/architecture/node-use")).toMatchObject({
|
||||
});
|
||||
|
||||
it("round-trips NodeUse as an optional architecture deep dive", () => {
|
||||
const nodeUseDeepDive = {
|
||||
kind: "main" as const,
|
||||
sceneId: "architecture" as const,
|
||||
beatId: "overview",
|
||||
focusPath: ["node-use"],
|
||||
});
|
||||
};
|
||||
|
||||
expect(hashForLocation(nodeUseDeepDive)).toBe(
|
||||
"#scene/architecture/overview/focus/node-use",
|
||||
);
|
||||
expect(locationFromHash(hashForLocation(nodeUseDeepDive))).toEqual(nodeUseDeepDive);
|
||||
});
|
||||
|
||||
it("round-trips an explicit root view for a beat with an authored nested focus", () => {
|
||||
|
||||
Reference in New Issue
Block a user