/** * FZ-8939 (LC-18): the Edges story mounted a bare `ReactFlow`, so its pane and * nodes painted React Flow's own dark grey (#141414, #1e1e1e) while the page * and the edges took the tinted house ramp (Tier 2 * `nodegraph-edges--main--dark`). The lanes render through the house canvas: * inside the graph root, under its theme vars, with house nodes. */ import { Preset, Surface } from "@multiplatform.one/theme"; import { renderWithProviders } from "@multiplatform.one/test-utils"; import { cleanup } from "@testing-library/react"; import type { ComponentType } from "react"; import { afterEach, describe, expect, it } from "vitest"; import { graphRootClassName } from "../theme/GraphVarsStyle"; import { resetNodeCensus } from "../react-flow/nodeCensus"; import { builtinEdgeKindNames } from "./edgeKinds"; import { labels, main } from "./Edges.stories"; afterEach(() => { cleanup(); resetNodeCensus(); }); function mount(story: { render: () => unknown }) { const Story = story.render as ComponentType; return renderWithProviders( , ); } describe("NodeGraph/Edges renders on the house canvas (FZ-8939)", () => { it.each([ ["Main", main], ["Labels", labels], ])("%s: the pane sits in the graph root under its theme vars, with house nodes", (_, story) => { const { container } = mount(story); const flow = container.querySelector(".react-flow") as HTMLElement | null; expect(flow, "a React Flow pane").not.toBeNull(); expect(flow!.closest(`.${graphRootClassName}`), "inside the graph root").not.toBeNull(); expect(container.querySelector("style[data-mpo-graph-vars]"), "the theme vars").not.toBeNull(); const nodes = container.querySelectorAll(".react-flow__node"); expect(nodes.length).toBe(builtinEdgeKindNames.length * 2); expect(container.querySelectorAll(".react-flow__node-default").length).toBe(0); }); });