feat(FN-3091): add plugin view remount routing test coverage

Adds test coverage for plugin view remount routing behavior in the App component.

Fusion-Task-Id: FN-3091
This commit is contained in:
Fusion
2026-05-07 07:08:11 -07:00
committed by gsxdsm
parent 3575b5e445
commit 9057421112
10 changed files with 480 additions and 0 deletions

View File

@@ -784,6 +784,8 @@ describe("GET /api/plugins/dashboard-views", () => {
componentPath: "./views/Graph.js",
icon: "Network",
placement: "more",
order: 40,
description: "Dependency graph",
},
},
];
@@ -794,6 +796,28 @@ describe("GET /api/plugins/dashboard-views", () => {
expect(res.status).toBe(200);
expect(res.body).toEqual(mockViews);
});
it("returns exactly pluginLoader dashboard-view entries (no synthesized plugin rows)", async () => {
(pluginLoader.getPluginDashboardViews as ReturnType<typeof vi.fn>).mockReturnValue([
{
pluginId: "with-view",
view: {
viewId: "graph",
label: "Graph",
componentPath: "./Graph.js",
},
},
]);
const res = await performGet(buildApp(), "/api/plugins/dashboard-views");
expect(res.status).toBe(200);
expect(res.body).toHaveLength(1);
expect(res.body[0]).toMatchObject({
pluginId: "with-view",
view: { viewId: "graph", label: "Graph", componentPath: "./Graph.js" },
});
});
});
describe("GET /api/plugins/ui-slots", () => {