test: 修复浏览器回归 fixture 契约漂移
- 补齐 trust content 与模板版本 fixture 的必填字段\n- mock template-operations/failures 的完整响应结构\n- 补全完整浏览器回归的启动步骤与 CORS 要求\n\n完整回归 32 个用例全部通过。
This commit is contained in:
1 parent
18bcdbeb00
commit
84522a8908
5 files changed
+65
-6
No files matched your search
@@ -11,13 +11,17 @@ const manifest = JSON.parse(
|
||||
);
|
||||
const version = {
|
||||
id: "preview-browser-version",
|
||||
templatePackageId: "preview-browser-package",
|
||||
packageKey: manifest.packageKey,
|
||||
version: manifest.version,
|
||||
displayName: manifest.displayName,
|
||||
status: "imported",
|
||||
contentChecksum: "fixture-checksum",
|
||||
archiveChecksum: "fixture-archive-checksum",
|
||||
importedAt: "2026-10-21T00:00:00.000Z",
|
||||
updatedAt: "2026-10-21T00:00:00.000Z",
|
||||
manifestSnapshot: manifest,
|
||||
importedBy: { displayName: "模板管理员" },
|
||||
importedBy: { id: "template-admin", username: "admin", displayName: "模板管理员" },
|
||||
validationReport: {},
|
||||
manifestSummary: { supportedIndustryTemplates: manifest.supportedIndustryTemplates },
|
||||
};
|
||||
@@ -103,6 +107,16 @@ test("模板管理可重试预览,并切换我的、详情和禁止提交的
|
||||
}
|
||||
if (url.pathname.endsWith("/admin/templates"))
|
||||
return route.fulfill({ json: { items: [version], page: 1, pageSize: 20, total: 1 } });
|
||||
if (url.pathname.endsWith("/admin/template-operations/failures"))
|
||||
return route.fulfill({
|
||||
json: {
|
||||
since: "2026-09-21T00:00:00.000Z",
|
||||
until: "2026-10-21T00:00:00.000Z",
|
||||
days: 30,
|
||||
backfilled: true,
|
||||
failures: [],
|
||||
},
|
||||
});
|
||||
if (url.pathname.endsWith("/admin/brands")) return route.fulfill({ json: [] });
|
||||
return route.fulfill({ json: { name: "测试工作区" } });
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user