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.

tests: resolve every closure name in the restoreSettings sandbox (#13617)

Daniel Han85c2c2f55aad
diff --git a/studio/frontend/tests/image-restore-negative-prompt.test.ts b/studio/frontend/tests/image-restore-negative-prompt.test.ts
index ddcadb5a9bf..d9e1fc6ec87 100644
--- a/studio/frontend/tests/image-restore-negative-prompt.test.ts
+++ b/studio/frontend/tests/image-restore-negative-prompt.test.ts
@@ -44,9 +44,13 @@ function restoreSettingsWith(negativeCapable: boolean) {
CONDITIONED_WORKFLOW_INPUTS: {},
toast: { success: () => {} },
};
+ // Every closure name the callback reads that is not a real global resolves to a recording no-op,
+ // so a new dependency of restoreSettings (#13569 added changeSamplerChoice / samplerOptions) does
+ // not throw a ReferenceError before the negative prompt is reached. Globals (String, Number, Array)
+ // still resolve to the real ones.
const scope = new Proxy(known, {
has: (target, key) =>
- typeof key === "string" && (key in target || /^set[A-Z]/.test(key)),
+ typeof key === "string" && (key in target || !(key in globalThis)),
get: (target, key) =>
typeof key === "string" && key in target
? target[key]