mirror of
https://github.com/openclaw/openclaw.git
synced 2026-09-28 14:12:28 +08:00
* feat(ui): complete the ClawHub plugin catalog * fix(test): keep plugin fixtures module-local * fix(ui): keep plugin card cursor scoped to links * fix(ui): align catalog controls with shared contracts * test(ui): wait for restored plugin search focus * test(plugins): align catalog preview expectations * test(ui): scope plugin workspace tab assertions
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { Value } from "typebox/value";
|
|
import { describe, expect, it } from "vitest";
|
|
import {
|
|
PluginsCatalogBrowseResultSchema,
|
|
PluginsCatalogCategoriesResultSchema,
|
|
} from "../../packages/gateway-protocol/src/schema/plugins.js";
|
|
import {
|
|
buildPluginDiscoveryCategoriesMock,
|
|
buildPluginDiscoveryMock,
|
|
} from "../../scripts/control-ui-mock-plugins.js";
|
|
|
|
describe("Control UI plugin discovery preview", () => {
|
|
it("provides visible ClawHub rows with valid joined local state", () => {
|
|
const result = buildPluginDiscoveryMock();
|
|
|
|
expect(Value.Check(PluginsCatalogBrowseResultSchema, result)).toBe(true);
|
|
expect(result.items.length).toBeGreaterThan(0);
|
|
expect(result.items.some((plugin) => plugin.local.installed)).toBe(true);
|
|
expect(result.items.some((plugin) => !plugin.local.installed)).toBe(true);
|
|
});
|
|
|
|
it("provides valid catalog categories for visual review", () => {
|
|
const result = buildPluginDiscoveryCategoriesMock();
|
|
|
|
expect(Value.Check(PluginsCatalogCategoriesResultSchema, result)).toBe(true);
|
|
expect(result.categories.map((category) => category.slug)).toEqual([
|
|
"channels",
|
|
"models",
|
|
"memory",
|
|
"context",
|
|
"voice",
|
|
"media",
|
|
"web",
|
|
"tools",
|
|
"runtime",
|
|
"gateway",
|
|
"security",
|
|
"other",
|
|
]);
|
|
});
|
|
});
|