功能修改
This commit is contained in:
@@ -2,6 +2,7 @@ import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { PluginsPage } from "./PluginsPage";
|
||||
import pluginsPageSource from "./PluginsPage.tsx?raw";
|
||||
import type { MarketplacePluginResponse } from "../api/types";
|
||||
|
||||
const marketplacePlugin: MarketplacePluginResponse = {
|
||||
@@ -22,6 +23,7 @@ const marketplacePlugin: MarketplacePluginResponse = {
|
||||
pages: [{ key: "logs", title: "Logs", path: "/logs", permissions: ["server.logs.read"], bridgeActions: ["logs.query"] }],
|
||||
tags: ["example"],
|
||||
aiPurposes: ["logs.diagnose"],
|
||||
productionLifecycle: { operations: ["install", "enable", "disable", "upgrade", "rollback", "retire", "dependency-check"], dependencyPolicy: "optional", approvalRequired: ["disable", "rollback", "retire"] },
|
||||
status: "installed",
|
||||
source: "platform-registry"
|
||||
};
|
||||
@@ -82,4 +84,15 @@ describe("PluginsPage", () => {
|
||||
expect(html).not.toContain('role="dialog"');
|
||||
expect(html).not.toContain("manifest validated");
|
||||
});
|
||||
|
||||
it("keeps state actions confirmed, permission-gated, and detail retryable", () => {
|
||||
expect(pluginsPageSource).toContain("ConfirmDialog");
|
||||
expect(pluginsPageSource).toContain("retryDetail");
|
||||
expect(pluginsPageSource).toContain("当前账号为只读模式");
|
||||
expect(pluginsPageSource).toContain("平台会返回持久状态");
|
||||
expect(pluginsPageSource).toContain("actionPending !== null");
|
||||
expect(pluginsPageSource).toContain("operations?.begin");
|
||||
expect(pluginsPageSource).toContain("operations?.succeed");
|
||||
expect(pluginsPageSource).toContain("operations?.fail");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user