fix(FN-1287): standardize dashboard API error responses
- Add shared ApiError class and response helpers for consistent error shape - Migrate routes and mission-routes handlers to use standardized API errors - Update server error middleware, rate limiter, and node metrics error handling to use shared helpers - Expand dashboard tests with ApiError coverage and standardized response assertions - Add a changeset documenting the @gsxdsm/fusion patch for API error shape standardization
This commit is contained in:
@@ -313,6 +313,15 @@ describe("Node routes", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("GET /api/nodes/:id/metrics returns 501 for remote nodes", async () => {
|
||||
mockGetNode.mockResolvedValue(makeNode({ id: "node_2", type: "remote" }));
|
||||
|
||||
const res = await request(app, "GET", "/api/nodes/node_2/metrics");
|
||||
|
||||
expect(res.status).toBe(501);
|
||||
expect(res.body).toEqual({ error: "Remote node metrics not yet implemented" });
|
||||
});
|
||||
|
||||
it("PATCH /api/projects/:id assigns project to node when nodeId is provided", async () => {
|
||||
const res = await request(
|
||||
app,
|
||||
|
||||
Reference in New Issue
Block a user