Files
Jyotisha/frontend/tests/ui-kit-stores.test.ts
T
jesse-uxandGrok (agent loop) 1c428d7b6e
Independent Staging Quality Gate / validate (push) Failing after 19m8s
Independent Staging Quality Gate / publish (push) Skipped
跟上已经换过的界面检查,测试环境才能接着发布(BUG-1439)。
Co-Authored-By: Grok (agent loop)
2026-10-25 15:27:14 +08:00

24 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { useAccountStore } from "../src/stores/account-store.ts";
import { usePeopleStore } from "../src/stores/people-store.ts";
import { useSessionStore } from "../src/stores/session-store.ts";
import { useUiStore } from "../src/stores/ui-store.ts";
const home = readFileSync(new URL("../src/app/(app)/page.tsx", import.meta.url), "utf8");
test("K0 store skeletons exist and Home() does not move state into them", () => {
// 原值:Home() 不引用任何一个 store。
// 新值:Home() 只引用会话 store;人物、账户、界面三个 store 仍是空骨架。
// 原因:K2 把对话状态放进会话 store,Home() 的 useState 从 33 降到 25。另外三个还没接上。
assert.equal(useSessionStore.getState().placeholder, true);
assert.equal(typeof useSessionStore.getState().setSessions, "function");
assert.equal(usePeopleStore.getState().placeholder, true);
assert.equal(useAccountStore.getState().placeholder, true);
assert.equal(useUiStore.getState().placeholder, true);
assert.match(home, /useSessionStore/);
assert.doesNotMatch(home, /usePeopleStore|useAccountStore|useUiStore/);
});