feat: collapse mobile note after first backfill

This commit is contained in:
巫凤萍
2026-08-12 20:44:57 +08:00
parent ee6caaf9e5
commit ad3dbdcc86
3 changed files with 128 additions and 4 deletions

View File

@@ -18,12 +18,13 @@ test("builds the branded external task shell", async () => {
});
test("keeps claiming minimal and backfill one-to-one", async () => {
const [page, layout, packageJson, nextConfig] =
const [page, layout, packageJson, nextConfig, styles] =
await Promise.all([
readFile(new URL("../app/page.tsx", import.meta.url), "utf8"),
readFile(new URL("../app/layout.tsx", import.meta.url), "utf8"),
readFile(new URL("../package.json", import.meta.url), "utf8"),
readFile(new URL("../next.config.ts", import.meta.url), "utf8"),
readFile(new URL("../app/globals.css", import.meta.url), "utf8"),
]);
assert.match(page, /微信号\s*\/\s*手机号/);
@@ -53,6 +54,13 @@ test("keeps claiming minimal and backfill one-to-one", async () => {
assert.match(page, /action:\s*"recover"/);
assert.match(page, /同一任务多次领取会分批展示/);
assert.match(page, /这篇笔记已回填,不会与其他笔记错配/);
assert.match(page, /笔记内容已收起/);
assert.match(page, /展开笔记内容/);
assert.match(page, /收起笔记内容/);
assert.match(page, /isFirstBackfill/);
assert.match(page, /scrollIntoView/);
assert.match(page, /matchMedia\("\(max-width: 620px\)"\)/);
assert.match(styles, /\.note-document\.mobile-collapsed/);
assert.doesNotMatch(page, /批量回填/);
assert.doesNotMatch(page, /复制标题和正文/);
assert.match(page, /CONFIGURED_ADMIN_ORIGIN/);