From 6a6c5aa3e2ae7dce663e2e58a6eca7b8de186be7 Mon Sep 17 00:00:00 2001 From: cyxer000 <48980829+cyxer000@users.noreply.github.com> Date: Thu, 1 Oct 2026 03:21:03 +0800 Subject: [PATCH] gui: omp-roles' and panel-effort's fake APIs answer /api/plugins as the other tests' do (#363) From #325's review: the two tests answered /api/plugins with the fallback {}, where 27 other tests answer {plugins: []}. The pages they open ask no bare /api/plugins today (the Plugins page asks /api/plugins/market), so what they see is the same; a page that comes to ask it gets the shape the server sends rather than an object without plugins. --- internal/gui/tests/omp-roles.test.cjs | 1 + internal/gui/tests/panel-effort.test.cjs | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/gui/tests/omp-roles.test.cjs b/internal/gui/tests/omp-roles.test.cjs index 906bf4613..4a8efe22f 100644 --- a/internal/gui/tests/omp-roles.test.cjs +++ b/internal/gui/tests/omp-roles.test.cjs @@ -46,6 +46,7 @@ function server(lang, sets) { if (url.pathname === "/api/groups") return route.fulfill({ json: { groups: [] } }); if (url.pathname === "/api/agents/cli") return route.fulfill({ json: { agents: {}, pending: false } }); if (url.pathname === "/api/providers") return route.fulfill({ json: { providers: [], gateway: { running: true } } }); + if (url.pathname === "/api/plugins") return route.fulfill({ json: { plugins: [] } }); if (url.pathname.startsWith("/api/")) return route.fulfill({ json: {} }); const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname); const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)]; diff --git a/internal/gui/tests/panel-effort.test.cjs b/internal/gui/tests/panel-effort.test.cjs index 49ccbabeb..ff6098a16 100644 --- a/internal/gui/tests/panel-effort.test.cjs +++ b/internal/gui/tests/panel-effort.test.cjs @@ -30,6 +30,7 @@ function server(lang, sets) { if (url.pathname === "/api/usage/quotas") return route.fulfill({ json: [] }); if (url.pathname === "/api/groups") return route.fulfill({ json: { groups: [] } }); if (url.pathname === "/api/providers") return route.fulfill({ json: { providers: [], gateway: { running: true } } }); + if (url.pathname === "/api/plugins") return route.fulfill({ json: { plugins: [] } }); if (url.pathname.startsWith("/api/")) return route.fulfill({ json: {} }); const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname); const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];