menu-scroll test: its fixture answers /api/upstream — the test failed 24/24 on main (Chromium and WebKit, every case "Target page, context or browser has been closed") since 2a990175 (#971), which has the Usage and Providers pages ask /api/upstream for the vendors' status pages. menu-scroll's route handler asserts on any API it doesn't serve; that assertion ("Unexpected API: /api/upstream") was an unhandled rejection, which ended the test, and its after hook closed the browser under the first gesture, so every later case failed on page.goto. The fixture now answers it with no vendor readings, as a page that couldn't be read marks nothing. No other GUI test throws on an unknown API without serving /api/upstream. No app change. menu-scroll passes 24/24 three runs in a row (it fails 12/12 Chromium at 2a990175 and passes 12/12 at its parent 62f9612b); click-scroll passes 18/18.

This commit is contained in:
yetone committed 2026-10-06 14:25:14 +08:00
1 parent a4553cec17
commit b2b72ea026
1 file changed
+1
+1
View File
@@ -41,6 +41,7 @@ async function serve(route) {
if (url.pathname === "/api/plugins/updates") return json({ waiting: [] });
if (url.pathname === "/api/usage/quotas" || url.pathname === "/api/usage/quotas/history" || url.pathname === "/api/agents/install") return json([]);
if (url.pathname === "/api/whatsnew") return json({});
if (url.pathname === "/api/upstream") return json({ vendors: [], providers: {} });
assert(!url.pathname.startsWith("/api/"), "Unexpected API: " + url.pathname);
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)];