This commit is contained in:
2026-09-20 23:35:03 +08:00
parent 941ce4baab
commit 388c700996
19 changed files with 393 additions and 71 deletions

View File

@@ -80,6 +80,18 @@ check('prependClip 熄灭空状态(#empty)', () => {
);
});
check('prependClip 重排 slot 徽标数字(后移的卡序号 +1)', () => {
// 新卡插到最顶后,原第 1-9 位的卡整体后移:只隐藏第 10 位会留下两个「1」,
// 数字键 1-9 按实际下标复制,显示序号与按键错位。曾被"优化"成只动边界卡,
// 这里守住:必须把后移卡的 textContent 改写成 i+1。
const prepend = rendererSrc.match(/function\s+prependClip\s*\([\s\S]*?\n\}/);
assert.ok(prepend, '找不到 prependClip()');
assert.ok(
/slotEl\.textContent\s*=\s*String\(\s*i\s*\+\s*1\s*\)/.test(prepend[0]),
'prependClip 没有改写后移卡片的 slot 数字 —— 序号会与实际下标错位'
);
});
check('buildCard 的点击选中按运行时下标,不捕获构建时 i', () => {
// prependClip 会把已有卡片整体后移,捕获构建时下标的闭包会选中错误的项。
assert.ok(