feat: 书库导入导出/图片变体/书籍搜索/小组件运行时等
新增: - 书库导入导出(library_import/library_export)及测试 - 图片变体生成(image_variants)与响应式图片(responsiveImage) - 书籍搜索(bookSearch)+ BookSearch/LibrarySearchGrid 组件 - 小组件运行时(widgetRuntime)与静态检查(widgetLint) - 上传缓存中间件(upload_cache)与字体 CSS 提取脚本 其它: - 后端 handlers/services 全量调整 - 前端页面、组件、库函数与配置更新
This commit is contained in:
@@ -33,16 +33,18 @@ describe("questionJsonLd", () => {
|
||||
createdAt: "2026-09-01T00:00:00Z",
|
||||
author: { id: 3, name: "甲" },
|
||||
postId: 9,
|
||||
accepted: { id: 4, content: "用索引", created_at: "2026-09-02T00:00:00Z", author: { id: 5, name: "乙" } },
|
||||
accepted: { id: 4, floor: 1, content: "用索引", created_at: "2026-09-02T00:00:00Z", author: { id: 5, name: "乙" } },
|
||||
answers: [
|
||||
{ id: 4, content: "用索引", created_at: "2026-09-02T00:00:00Z", author: { id: 5, name: "乙" } },
|
||||
{ id: 6, content: "先 EXPLAIN", created_at: "2026-09-03T00:00:00Z" },
|
||||
{ id: 4, floor: 1, content: "用索引", created_at: "2026-09-02T00:00:00Z", author: { id: 5, name: "乙" } },
|
||||
{ id: 6, floor: 2, content: "先 EXPLAIN", created_at: "2026-09-03T00:00:00Z" },
|
||||
],
|
||||
});
|
||||
assert.ok(data);
|
||||
const q = data.mainEntity as { acceptedAnswer: { text: string }; suggestedAnswer: { text: string }[] };
|
||||
const q = data.mainEntity as { acceptedAnswer: { text: string; url: string }; suggestedAnswer: { text: string; url: string }[] };
|
||||
assert.equal(q.acceptedAnswer.text, "用索引");
|
||||
assert.equal(q.acceptedAnswer.url, "https://bbs.example.com/post/9#comment-1");
|
||||
assert.deepEqual(q.suggestedAnswer.map((a) => a.text), ["先 EXPLAIN"]);
|
||||
assert.equal(q.suggestedAnswer[0].url, "https://bbs.example.com/post/9#comment-2");
|
||||
assert.equal(data["@type"], "QAPage");
|
||||
});
|
||||
});
|
||||
@@ -57,11 +59,13 @@ describe("discussionJsonLd", () => {
|
||||
author: { id: 1, name: "丙" },
|
||||
postId: 8,
|
||||
pageUrl: "https://bbs.example.com/post/8?page=2",
|
||||
comments: [{ id: 2, content: "可见楼层", created_at: "2026-09-01T01:00:00Z" }],
|
||||
comments: [{ id: 2, floor: 21, content: "可见楼层", created_at: "2026-09-01T01:00:00Z" }],
|
||||
});
|
||||
assert.equal(data?.url, "https://bbs.example.com/post/8");
|
||||
const page = data?.mainEntityOfPage as { url: string };
|
||||
assert.equal(page.url, "https://bbs.example.com/post/8?page=2");
|
||||
assert.equal((data?.comment as { text: string }[])[0].text, "可见楼层");
|
||||
const firstComment = (data?.comment as { text: string; url: string }[])[0];
|
||||
assert.equal(firstComment.text, "可见楼层");
|
||||
assert.equal(firstComment.url, "https://bbs.example.com/post/8#comment-21");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user