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.
This commit is contained in:
cyxer000
2026-10-01 03:21:03 +08:00
committed by GitHub
parent df019e18e7
commit 6a6c5aa3e2
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -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)];
+1
View File
@@ -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)];