diff --git a/client/electron/test/harmony-admin.test.mjs b/client/electron/test/harmony-admin.test.mjs index 1905c70..7560b2e 100644 --- a/client/electron/test/harmony-admin.test.mjs +++ b/client/electron/test/harmony-admin.test.mjs @@ -487,11 +487,27 @@ test('★ 「我的」页整页一个滚动容器(排在 flex-1 之后的 sect } assert.ok(end > start, 'Scroll 的花括号要闭合'); const inside = src.slice(start, end); - for (const sec of ['ProfileSection', 'KeySection', 'SecuritySection', 'AdminSection']) { + /* + * ★★ 2026-09-21 改:`SecuritySection` 已**按 WebUI 拆成两段** + * (`PasswordSection` 改密码 + `LoginSection` 登录状态/退出登录), + * 所以判据不能再点名那个已经不存在的 builder —— 那会变成 + * 「守着一个历史名字」,与它真正要守护的东西(**可滚得到**)脱钩。 + * + * 改成**钉行为**:四类内容各自的可滚入口都要在 Scroll 里。 + * · `ProfileSection` 账号 + * · `PasswordSection` 修改密码(原 SecuritySection 的前半) + * · `LoginSection` 登录状态 + 退出登录(原 SecuritySection 的后半) + * · `AdminSection` 管理入口 + */ + for (const sec of ['ProfileSection', 'PasswordSection', 'LoginSection', 'AdminSection']) { assert.ok(inside.includes(`this.${sec}()`), `★ ${sec} 必须在 Scroll **内部** —— 排在 flex-1 之后会被裁掉且滚不到(WebUI 的注释里就有这个坑)`); } - assert.ok(inside.includes('退出登录') || /SecuritySection/.test(inside), + /* + * 「退不出去」是这条判据当初抓到的**真实危害**(不是"少一段"), + * 所以单独再钉一次:那个动作得真的在可滚动区里。 + */ + assert.ok(inside.includes('this.LoginSection()'), '退出登录要在可滚动区域内(否则退不出去)'); // 滚动容器要挂上下渐隐(与列表同一纪律) assert.match(src, /\.fadingEdge\(true,/, '滚动容器要挂 fadingEdge(WebUI .overflow-y-auto 的 mask-image)');