chore(spec): 归档 blog-5l——三任务收敛(预览一致性/排版提醒/瞬间置顶隐藏)

Spec: 2026-11-05_blog-5l-admin-preview-moments

Co-authored-by: GLM-5.3
This commit is contained in:
wait4xandGLM-5.3 committed 2026-11-05 10:03:34 +08:00
1 parent c5889f960b
commit b99e6e744b
17 files changed
+406 -17

No files matched your search

+18 -2
View File
@@ -37,7 +37,14 @@ ok('项目墙渲染', await page.locator('.project-wall, .repo').count() > 0);
// 0) Phase 5h:置顶 / 计数徽标 / 瞬间富文本与逐条评论 / 块式关于页
await page.goto(BASE + '/archives/', { waitUntil: 'networkidle' });
const firstArchive = await page.locator('.post-list a.row').first().getAttribute('href');
ok('5h·置顶排在归档首位', (firstArchive ?? '').includes('/archives/writing-template/'), firstArchive ?? 'none');
ok('5l·置顶首位=面纱', (firstArchive ?? '').includes('/archives/mian-sha/'), firstArchive ?? 'none');
// 用户已将写作模板 hidden(5j 真字段契约:列表移除、页面仍生成可分享)
{
const listed = await page.locator('.post-list a.row').evaluateAll((as_) =>
as_.some((a) => (a.getAttribute('href') || '').includes('/archives/writing-template/')),
);
ok('5l·隐藏文章不在列表', listed === false);
}
ok('5h·置顶徽标可见', (await page.locator('.pin').count()) > 0);
await page.goto(BASE + '/archives/writing-template/', { waitUntil: 'networkidle' });
@@ -48,13 +55,22 @@ ok('5h·模板折叠块渲染', (await page.locator('.prose-tech details').count
await page.goto(BASE + '/moments/', { waitUntil: 'networkidle' });
ok('5h·瞬间带逐条评论区', (await page.locator('details[data-mom-comments]').count()) > 0);
ok('5h·瞬间卡片带只读计数', (await page.locator('.mom-card [data-viewmeta]').count()) > 0);
// 5l:瞬间置顶——首卡带灰阶 pin 徽标,且置顶瞬间排在最前
ok('5l·置顶瞬间首卡带徽标', (await page.locator('.mom-card .pin').count()) > 0);
{
const first = page.locator('.mom-card .tl-date').first();
const badges = await page.locator('.mom-card').evaluateAll(
(cards) => cards.findIndex((c) => !!c.querySelector('.pin')),
);
ok('5l·置顶瞬间排最前', badges === 0);
}
await page.locator('details[data-mom-comments]').first().locator('summary').click();
await page.waitForTimeout(400);
// 计数徽标是 details 的兄弟(ViewMeta 根节点为 <p>,塞进 <summary> 属非法嵌套)
ok('5h·瞬间计数为只读模式', (await page.locator('.mom-cm-meta [data-viewmeta]').first().getAttribute('data-mode')) === 'readonly');
await page.goto(BASE + '/about/', { waitUntil: 'networkidle' });
ok('5h·关于页由块驱动', (await page.locator('[data-block]').count()) > 0, `blocks=${await page.locator('[data-block]').count()}`);
ok('5k·关于页白纸直编(doc 驱动)', (await page.locator('.about-doc').count()) > 0);
// 0b) Phase 5i:字体真加载 / 评论不误报 / 灯箱关闭 / 开源页动效与数据板
await page.goto(BASE + '/archives/writing-template/', { waitUntil: 'networkidle' });