Files

16 lines
839 B
TypeScript

import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { PluginLifecycleWorkbench } from "./PluginLifecycleWorkbench";
import lifecycleSource from "./PluginLifecycleWorkbench.tsx?raw";
describe("plugin operations components", () => {
it("renders persisted loading states without optimistic terminal success", () => {
expect(renderToStaticMarkup(<PluginLifecycleWorkbench pluginId="game.example" pluginName="Example" />)).toContain("正在同步插件生命周期");
expect(lifecycleSource).not.toContain("setTimeout");
expect(lifecycleSource).not.toMatch(/apiKeyRef|rawApiKey|runSocket|providerBaseUrl|hostPath|directRun/i);
expect(lifecycleSource).toContain("disabled=");
expect(lifecycleSource).toContain("if (!selectedServerId || busy) return");
});
});