feat(FN-3079): add plugin dashboard views and dependency graph plugin
- Add plugin dashboard view registration and hosting across core, dashboard routes, and plugin SDK exports - Integrate plugin-provided views into app navigation, mobile/header UI, and view state hooks with coverage - Add fusion-plugin-dependency-graph example plugin with persisted storage, dashboard view UI, and manifest wiring - Update plugin authoring and architecture docs for dashboard view extension points - Add a changeset for @runfusion/fusion covering plugin dashboard view support Fusion-Task-Id: FN-3079
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it, beforeEach } from "vitest";
|
||||
import { projectScopedKey, loadPositions, savePositions } from "../storage";
|
||||
|
||||
const createMemoryStorage = () => {
|
||||
const map = new Map<string, string>();
|
||||
return {
|
||||
getItem: (key: string) => map.get(key) ?? null,
|
||||
setItem: (key: string, value: string) => {
|
||||
map.set(key, value);
|
||||
},
|
||||
clear: () => map.clear(),
|
||||
};
|
||||
};
|
||||
|
||||
describe("storage", () => {
|
||||
const localStorage = createMemoryStorage();
|
||||
|
||||
beforeEach(() => {
|
||||
(globalThis as { window?: { localStorage?: typeof localStorage } }).window = { localStorage };
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
it("builds project-scoped key", () => {
|
||||
expect(projectScopedKey("proj_123")).toBe("kb:proj_123:dependency-graph-positions");
|
||||
});
|
||||
|
||||
it("persists and restores positions", () => {
|
||||
savePositions("proj_123", { "FN-1": { x: 10, y: 20 } });
|
||||
expect(loadPositions("proj_123")).toEqual({ "FN-1": { x: 10, y: 20 } });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user