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:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user