fix(web): expose organize recovery and file episode evidence
This commit is contained in:
1 parent
b7883eaf4f
commit
2b3ccb89e4
12 files changed
+390
-72
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import type { PublicOrganizationRecord } from "@umt/contracts";
|
||||
import { createElement } from "react";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { MemoryRouter } from "react-router";
|
||||
import { expect, it } from "vitest";
|
||||
import { DownloadOrganizeIssue } from "./download-detail.tsx";
|
||||
|
||||
const render = (status: PublicOrganizationRecord["status"]) =>
|
||||
renderToStaticMarkup(
|
||||
createElement(
|
||||
MemoryRouter,
|
||||
null,
|
||||
createElement(DownloadOrganizeIssue, {
|
||||
record: {
|
||||
id: "record",
|
||||
status,
|
||||
reason: { code: "episode_unresolved", message: "集数待确认" },
|
||||
} as PublicOrganizationRecord,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
it("下载详情中的部分结果与失败都指向原整理记录,成功没有问题提示", () => {
|
||||
expect(render("partial")).toContain("部分整理完成,还有文件需要处理");
|
||||
expect(render("partial")).toContain("/console/organize?open=record");
|
||||
expect(render("partial")).toContain("集数待确认");
|
||||
expect(render("partial")).toContain("text-warning");
|
||||
expect(render("failed")).toContain("整理失败");
|
||||
expect(render("failed")).toContain("text-destructive");
|
||||
expect(render("succeeded")).toBe("");
|
||||
});
|
||||
Reference in new issue
Block a user