mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-14 02:42:24 +03:00
UI completa do Orchestration Canvas sobre o modelo da parte 1: página /dashboard/orchestration com abas em URL (Agents=grafo vivo via FlowCanvas, Routing=ComboLiveStudio intocado, Overview=contadores+kanban com totais reais sob cap), drawer de detalhe com approve/cancel (unwrap por fonte verificado contra as rotas reais, erros client-safe, prUrl https-only), i18n com traduções REAIS em 43 locales, entrada no sidebar. Ciclo SDD: 9 tasks TDD com review por task (Task 15 com fix round: Critical A2A unwrap + rewrite de lint + guard XSS), review final whole-branch (Ready to merge, 0 Critical/Important, refactor de complexity provado behavior-preserving), 3 fixes de CI validados RED→GREEN. CI: tudo verde. Crédito do conceito visual: design da PR #11815.
86 lines
3.2 KiB
TypeScript
86 lines
3.2 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
const sidebarVisibility = await import("../../src/shared/constants/sidebarVisibility.ts");
|
|
|
|
function getToolsGroup() {
|
|
const omniProxySection = sidebarVisibility.SIDEBAR_SECTIONS.find(
|
|
(section) => section.id === "omni-proxy"
|
|
);
|
|
assert.ok(omniProxySection, "expected omni-proxy section to exist");
|
|
|
|
const toolsGroup = omniProxySection.children.find(
|
|
(
|
|
child
|
|
): child is (typeof sidebarVisibility.SIDEBAR_SECTIONS)[number]["children"][number] & {
|
|
type: "group";
|
|
} =>
|
|
"type" in child &&
|
|
(child as { type: string }).type === "group" &&
|
|
(child as { id: string }).id === "tools"
|
|
);
|
|
assert.ok(toolsGroup, "expected tools group to exist in omni-proxy section");
|
|
return toolsGroup as {
|
|
type: "group";
|
|
id: string;
|
|
items: readonly { id: string; href: string; i18nKey: string }[];
|
|
};
|
|
}
|
|
|
|
test("TOOLS_GROUP items follow plan 14 order: cli-code → cli-agents → acp-agents → cloud-agents → conductor → orchestration → agent-bridge → traffic-inspector → discovery", () => {
|
|
const toolsGroup = getToolsGroup();
|
|
const itemIds = toolsGroup.items.map((item) => item.id);
|
|
// cli-code/cli-agents/acp-agents/cloud-agents from plan 14 (#2839); agent-bridge/traffic-inspector from plans 11/12 (#2858); discovery from #5939; conductor from the Conductor panel (PRD RF3, #8221).
|
|
assert.deepEqual(
|
|
itemIds,
|
|
[
|
|
"cli-code",
|
|
"cli-agents",
|
|
"acp-agents",
|
|
"cloud-agents",
|
|
"conductor",
|
|
"orchestration", // +1: orchestration (PR-2 of the orchestration canvas)
|
|
"agent-bridge",
|
|
"traffic-inspector",
|
|
"discovery",
|
|
],
|
|
"TOOLS_GROUP items order must be cli-code, cli-agents, acp-agents, cloud-agents, conductor, orchestration, agent-bridge, traffic-inspector, discovery"
|
|
);
|
|
});
|
|
|
|
test("TOOLS_GROUP cli-code item has correct href and i18nKey", () => {
|
|
const toolsGroup = getToolsGroup();
|
|
const cliCode = toolsGroup.items.find((item) => item.id === "cli-code");
|
|
assert.ok(cliCode, "expected cli-code in TOOLS_GROUP");
|
|
assert.equal(cliCode.href, "/dashboard/cli-code");
|
|
assert.equal(cliCode.i18nKey, "cliCode");
|
|
});
|
|
|
|
test("TOOLS_GROUP cli-agents item has correct href and i18nKey", () => {
|
|
const toolsGroup = getToolsGroup();
|
|
const cliAgents = toolsGroup.items.find((item) => item.id === "cli-agents");
|
|
assert.ok(cliAgents, "expected cli-agents in TOOLS_GROUP");
|
|
assert.equal(cliAgents.href, "/dashboard/cli-agents");
|
|
assert.equal(cliAgents.i18nKey, "cliAgents");
|
|
});
|
|
|
|
test("TOOLS_GROUP acp-agents item has correct href and i18nKey", () => {
|
|
const toolsGroup = getToolsGroup();
|
|
const acpAgents = toolsGroup.items.find((item) => item.id === "acp-agents");
|
|
assert.ok(acpAgents, "expected acp-agents in TOOLS_GROUP");
|
|
assert.equal(acpAgents.href, "/dashboard/acp-agents");
|
|
assert.equal(acpAgents.i18nKey, "acpAgents");
|
|
});
|
|
|
|
test("TOOLS_GROUP does NOT contain legacy cli-tools or agents entries", () => {
|
|
const toolsGroup = getToolsGroup();
|
|
const legacyIds = toolsGroup.items
|
|
.map((item) => item.id)
|
|
.filter((id) => id === "cli-tools" || id === "agents");
|
|
assert.deepEqual(
|
|
legacyIds,
|
|
[],
|
|
"TOOLS_GROUP must not contain legacy 'cli-tools' or 'agents' entries"
|
|
);
|
|
});
|