fix(web): expose organize recovery and file episode evidence

This commit is contained in:
root committed 2026-10-13 20:26:43 +08:00
1 parent b7883eaf4f
commit 2b3ccb89e4
12 files changed
+390 -72

No files matched your search

@@ -96,7 +96,7 @@ describe("待处理「集数待确认」", () => {
simulation: null,
}),
);
expect(html).toContain("在上面的作品识别词里手动写");
expect(html).toContain("展开作品识别词后手动写");
});
it("模拟结果一句话", () => {
@@ -186,3 +186,45 @@ describe("季集映射调查状态", () => {
expect(renderStatus(decision())).toBe("");
});
});
it("文件事项显示原号、文件路径与已对上的校验样本,不虚构资源数量", () => {
const sample = (ep: number, pending: boolean) => ({
recordId: "record",
path: `/anime/E${ep}.mkv`,
parsed: { season: 1, episodes: { start: ep, end: ep } },
publishedAt: null,
resolution: {
method: pending ? "unresolved" : "raw",
source: { season: 1, episodes: { start: ep, end: ep } },
canonical: pending ? null : { season: 1, episodes: { start: ep, end: ep } },
},
});
const view = episodeDecisionView(
decision({
evidence: {
mediaEntityId: ENTITY,
count: 1,
sourceReleaseIds: [],
fileSamples: [sample(13, true), sample(1, false)],
},
}),
);
expect(view.files.map((f) => f.pending)).toEqual([true, false]);
const out = renderToStaticMarkup(createElement(EpisodeDecisionBody, { view, simulation: null }));
expect(out).toContain("待确认文件");
expect(out).toContain("S01E13");
expect(out).toContain("/anime/E13.mkv");
expect(out).toContain("已对上的 1 个文件");
expect(out).toContain("S01E01 → S01E01");
expect(out).not.toContain("来源季集");
expect(out).not.toContain("另有");
const mixed = episodeDecisionView(
decision({
evidence: { ...decision().evidence, count: 3, sourceReleaseIds: ["a", "b"], fileSamples: [sample(13, true)] },
}),
);
expect(mixed.releaseCount).toBe(2);
expect(renderToStaticMarkup(createElement(EpisodeDecisionBody, { view: mixed, simulation: null }))).not.toContain(
"另有",
);
});