From c72474d12399fd0832f6c0d6ae7f16fd208fd471 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 17 Oct 2026 17:05:52 +0800 Subject: [PATCH] test: integration asserts match new demo dataset (25 footprints / 10 awards) --- scripts/test-integration.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/test-integration.mjs b/scripts/test-integration.mjs index f43a33e..e652f79 100644 --- a/scripts/test-integration.mjs +++ b/scripts/test-integration.mjs @@ -57,7 +57,7 @@ const rootMe = await api(A, 'GET', '/auth/me', undefined, T); ok(rootMe.body?.data?.username === 'root' && rootMe.body?.data?.is_admin === true, 'root 是管理员', rootMe.body); const fp = await api(A, 'POST', '/api/footprint_list', { query: { page: 1, page_size: 50 } }, D); -ok(fp.body?.data?.total === 18, '演示足迹 18 条(播种成功)', fp.body?.data?.total); +ok(fp.body?.data?.total === 25, '演示足迹 25 条(播种成功,含 10 项竞赛+证书附件)', fp.body?.data?.total); const grades = await api(A, 'POST', '/api/grades_overview', {}, D); ok(grades.body?.data?.semesters?.length === 4, '演示学期 4 个', grades.body?.data?.semesters?.length); const tl = await api(A, 'POST', '/api/timeline', { query: {} }, D); @@ -167,7 +167,7 @@ ok(reseed.body?.data?.seeded === false, '重复播种幂等跳过', reseed.body) // demo 重建路由(管理员):重置 demo 数据为初始播种态 const re2 = await api(A, 'POST', '/admin/demo-rebuild', {}, T); -ok(re2.status === 200 && re2.body?.data?.seeded?.footprints === 18, 'demo 重建路由可达', re2.body); +ok(re2.status === 200 && re2.body?.data?.seeded?.footprints === 25, 'demo 重建路由可达', re2.body); // ---------- Phase B:同一数据目录「重启」(新模块实例 + 新端口) ---------- console.log('\n== Phase B:重启后(持久化 + 不重复播种) =='); @@ -180,7 +180,7 @@ const rootLogin2 = await api(B, 'POST', '/auth/login', { username: 'root', passw ok(rootLogin2.status === 200, '重启后 root 可登录', rootLogin2.body); const T2 = rootLogin2.body.data.token; const fp2 = await api(B, 'POST', '/api/footprint_list', { query: { page: 1, page_size: 50 } }, D2); -ok(fp2.body?.data?.total === 18, '重启后仍是 18 条(测试足迹已被级联删除)', fp2.body?.data?.total); +ok(fp2.body?.data?.total === 25, '重启后仍是 25 条(测试足迹已被级联删除)', fp2.body?.data?.total); const list2 = (await api(B, 'GET', '/admin/invites', undefined, T2)).body.data.invites; ok(list2.some((i) => i.code === 'XIONG-FRIEND-2025'), '邀请码跨重启持久化');