21 lines
952 B
TypeScript
21 lines
952 B
TypeScript
import { renderToStaticMarkup } from "react-dom/server";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { SCUMPersistedDataView, scumDatasetForPluginRoute } from "./SCUMPersistedDataView";
|
|
|
|
describe("SCUMPersistedDataView", () => {
|
|
it("maps the five declared SCUM plugin routes to persisted datasets", () => {
|
|
expect(scumDatasetForPluginRoute("players")).toBe("users");
|
|
expect(scumDatasetForPluginRoute("squads")).toBe("squads");
|
|
expect(scumDatasetForPluginRoute("workflows")).toBe("activity");
|
|
expect(scumDatasetForPluginRoute("gifts")).toBe("gifts");
|
|
expect(scumDatasetForPluginRoute("live-map")).toBe("map");
|
|
});
|
|
|
|
it("renders a themed loading state without synthetic records", () => {
|
|
const html = renderToStaticMarkup(<SCUMPersistedDataView serverInstanceId="server-1" dataset="users" />);
|
|
expect(html).toContain("正在读取用户同步数据");
|
|
expect(html).not.toContain("Prisoner One");
|
|
});
|
|
});
|