Files
OmniRoute/tests/unit/ws-agents-channel.test.ts
Diego Rodrigues de Sa e Souza 6b4519c317 feat(dashboard): orchestration canvas fase 2 — agents WS channel (2.1) (#12409)
* feat(dashboard): agents WS channel + agent.task.updated event

* feat(a2a): publish agent.task.updated on cloud-agent and a2a task writes

* feat(dashboard): mirror conductor fleet transitions into agents channel

* feat(dashboard): orchestration snapshot rides the agents WS channel (2.1)

---------

Co-authored-by: Markus Hartung <diegosouzapw@users.noreply.github.com>
2026-09-02 01:19:49 -03:00

21 lines
756 B
TypeScript

import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { CHANNEL_EVENTS, getChannelForEvent } from "../../src/lib/events/types.ts";
import { emit, on } from "../../src/lib/events/eventBus.ts";
describe("agents WS channel (B1)", () => {
it("agents channel maps agent.task.updated", () => {
assert.deepEqual(CHANNEL_EVENTS.agents, ["agent.task.updated"]);
assert.equal(getChannelForEvent("agent.task.updated"), "agents");
});
it("emit/on round-trip", () => {
const seen: unknown[] = [];
const off = on("agent.task.updated", (p) => seen.push(p));
emit("agent.task.updated", { source: "a2a", taskId: "t1", state: "working", timestamp: 1 });
off();
assert.equal(seen.length, 1);
});
});