The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
// @vitest-environment jsdom
import { flushSync } from "react-dom";
import { createRoot } from "react-dom/client";
import { MemoryRouter } from "react-router-dom";
import { describe, expect, it, vi } from "vitest";
import { DecisionHistoryTable } from "./DecisionHistory";
vi.mock("@/context/CompanyContext", () => ({
useCompany: () => ({ selectedCompany: { issuePrefix: "ACM" } }),
}));
describe("model history setup links", () => {
it.each([
[false, true, "/ACM/company/settings/connections", "Configure a decision model"],
[false, false, "/ACM/company/settings/connections", "Configure a decision model"],
[true, true, "/ACM/company/settings/connections", "Configure fast response"],
[true, false, "/ACM/company/settings/instance/experimental", "Enable experimental fast responses"],
] as const)("routes setup with fast response %s and experiment %s", (fastResponse, fastResponsesEnabled, href, label) => {
const container = document.createElement("div");
const root = createRoot(container);
try {
flushSync(() => root.render(
<MemoryRouter>
<DecisionHistoryTable entries={[]} fastResponse={fastResponse} fastResponsesEnabled={fastResponsesEnabled} />
</MemoryRouter>,
));
expect(container.querySelector("a")?.getAttribute("href")).toBe(href);
expect(container.querySelector("a")?.textContent).toBe(label);
} finally {
flushSync(() => root.unmount());
}
});
});