Files
openclaw/test/scripts/plugin-inventory-doc.test.ts
T
Peter Steinberger c70aee247e refactor(scripts): migrate JavaScript tools to TypeScript (#121005)
* refactor(scripts): migrate JavaScript tools to TypeScript

* fix(ci): keep changed-scope preflight zero-install

* fix(ci): preserve zero-install script owners

* fix(ci): complete script migration follow-through

* fix(release): keep stable closeout zero-install

* fix(scripts): preserve standalone execution boundaries

* fix(scripts): repair standalone loader boundaries

* fix(scripts): normalize gateway observation ids

* fix(scripts): keep Docker packager standalone

* test(scripts): preserve rebase cleanup helpers

* test(sessions): use tracked temp directory
2026-08-09 07:21:35 -07:00

45 lines
1.5 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { resolvePluginSurface } from "../../scripts/lib/plugin-inventory-doc.mts";
describe("resolvePluginSurface", () => {
it("keeps manifest identifiers as inline code while leaving labels visible", () => {
expect(
resolvePluginSurface({
id: "example",
channels: ["discord"],
providers: ["openai"],
contracts: {
webSearchProviders: {},
tools: {},
},
dashboard: {
dataBindings: [{ id: "items.list" }],
actionVerbs: [{ id: "refresh" }],
},
skills: ["example"],
}),
).toBe(
"channels: `discord`; providers: `openai`; contracts: `tools`, `webSearchProviders`; dashboard data bindings: `example.items.list`; dashboard action verbs: `example.refresh`; skills",
);
});
it("retains the generic fallback", () => {
expect(resolvePluginSurface({})).toBe("plugin");
});
it("escapes dashboard plugin owner delimiters and literal escape markers", () => {
expect(
resolvePluginSurface({
id: "dashboard.segmented",
dashboard: { actionVerbs: [{ id: "refresh" }] },
}),
).toBe("dashboard action verbs: `dashboard%2Esegmented.refresh`");
expect(
resolvePluginSurface({
id: "dashboard%2Esegmented",
dashboard: { dataBindings: [{ id: "refresh" }] },
}),
).toBe("dashboard data bindings: `dashboard%252Esegmented.refresh`");
});
});