Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Tray status test: end the listener slice at its own close (#16600)

Daniel Han6f791972ef74
diff --git a/studio/frontend/tests/tray-server-status.test.ts b/studio/frontend/tests/tray-server-status.test.ts
index 72bd4d77f51..4c24a6f41b6 100644
--- a/studio/frontend/tests/tray-server-status.test.ts
+++ b/studio/frontend/tests/tray-server-status.test.ts
@@ -47,7 +47,13 @@ function actionableStatuses(hook: string): string[] {
if (start < 0) {
throw new Error("the tray-toggle-server listener is gone");
}
- const listener = hook.slice(start, hook.indexOf("});", start));
+ // End at the call's own close, matched by indent: a nested `});` (a .catch) ends earlier.
+ const indent = hook.slice(hook.lastIndexOf("\n", start) + 1, start);
+ const end = hook.indexOf(`\n${indent}});`, start);
+ if (!/^[ ]*$/.test(indent) || end < 0) {
+ throw new Error("the tray-toggle-server listener no longer starts its own line");
+ }
+ const listener = hook.slice(start, end);
return [
...new Set(
[...listener.matchAll(/statusRef\.current === "([^"]*)"/g)].map(