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,24 @@
|
||||
import { createElement } from "react";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { MemoryRouter } from "react-router";
|
||||
import { expect, it, vi } from "vitest";
|
||||
import { EpisodeMappingPanel } from "./mapping-panel.tsx";
|
||||
|
||||
vi.mock("~/api/episode-mapping.ts", () => ({
|
||||
useEntityWords: () => ({ isSuccess: true, data: { block: { text: "saved-rule" }, knownGroups: [] } }),
|
||||
useEpisodeMappingPreview: () => ({ data: { seasons: { seasons: [] }, groups: [], items: [] } }),
|
||||
}));
|
||||
vi.mock("./issues.tsx", () => ({ EpisodeIssuesList: () => createElement("p", null, "待确认文件的问题") }));
|
||||
vi.mock("~/components/identify-words/words-editor.tsx", () => ({
|
||||
WordsEditor: ({ draft }: { draft: string }) => createElement("textarea", { defaultValue: draft }),
|
||||
}));
|
||||
|
||||
it("先展示待处理问题,长期规则默认折叠且保留原编辑器草稿", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
createElement(MemoryRouter, null, createElement(EpisodeMappingPanel, { entityId: "entity" })),
|
||||
);
|
||||
expect(html.indexOf("待确认文件的问题")).toBeLessThan(html.indexOf("作品识别词 · 长期规则"));
|
||||
expect(html).toContain("<details");
|
||||
expect(html).not.toMatch(/<details[^>]* open/);
|
||||
expect(html).toContain("saved-rule");
|
||||
});
|
||||
Reference in new issue
Block a user