botGroupTaskScope.test.ts 901 B

123456789101112131415161718192021222324252627
  1. import { describe, expect, it } from "vitest";
  2. import { bindBotGroupTaskScope } from "../src/host/botGroupTaskScope.js";
  3. describe("group remote task attachment", () => {
  4. it("injects the validated remote identity and session over caller supplied routing", () => {
  5. expect(
  6. bindBotGroupTaskScope(
  7. { taskId: "task", workspaceIdentity: "forged", remoteSessionId: "stale" },
  8. {
  9. kind: "remote",
  10. workspacePath: "/work",
  11. workspaceIdentity: "ssh://host/work",
  12. remoteSessionId: "current",
  13. },
  14. ),
  15. ).toEqual({
  16. taskId: "task",
  17. workspacePath: "/work",
  18. workspaceIdentity: "ssh://host/work",
  19. remoteSessionId: "current",
  20. });
  21. });
  22. it("keeps local task routing unchanged", () => {
  23. const params = { taskId: "task" };
  24. expect(bindBotGroupTaskScope(params, { kind: "local" })).toBe(params);
  25. });
  26. });