Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test: isolate settings tab fixtures (#7221)

LearningCircuit17bd7cc9eb2c
diff --git a/tests/js/components/settings-empty-provider-tabs.test.js b/tests/js/components/settings-empty-provider-tabs.test.js
index 4dd0935669..57754b8e26 100644
--- a/tests/js/components/settings-empty-provider-tabs.test.js
+++ b/tests/js/components/settings-empty-provider-tabs.test.js
@@ -10,11 +10,9 @@
*
* Lives in its own file: the settings component captures its DOM element
* references at import time, so it must be imported against a fresh DOM
- * (vitest isolates modules per file, not per test). The second test below
- * needs its own fresh import too, so it calls `vi.resetModules()`
- * immediately before importing the component — the same pattern used by
- * tests/js/components/settings-reset-ordering.test.js to get more than one
- * `it()` per file against this module.
+ * (vitest isolates modules per file, not per test). Reset the module cache
+ * before every test so each import binds to that test's fixture, including
+ * when shuffle runs the absent-provider case first (#7217).
*/
import '@js/config/urls.js';
@@ -48,6 +46,10 @@ function setting(overrides) {
};
}
+beforeEach(() => {
+ vi.resetModules();
+});
+
afterEach(() => {
vi.restoreAllMocks();
vi.unstubAllGlobals();
@@ -222,8 +224,6 @@ it('keeps tab scoping when the llm.provider row is absent from the fixture entir
// de-dup/tab-scoping logic) would have been just as dead here as for an
// empty value, so this pins the same safe-direction behavior for the
// other shape a "no provider selected" fixture can take.
- vi.resetModules();
-
document.head.insertAdjacentHTML(
'beforeend',
'<meta name="csrf-token" content="csrf-absent-provider">',