feat(workbench): integrate runtime data and map tooling
This commit is contained in:
@@ -122,6 +122,20 @@ describe("Agent API client sessions", () => {
|
||||
expect(headers.get("Content-Type")).toBe("application/json");
|
||||
});
|
||||
|
||||
it("sends the authorized project context on Agent requests", async () => {
|
||||
const fetchMock = vi.fn(async (_input: RequestInfo | URL, _init?: RequestInit) =>
|
||||
new Response(JSON.stringify({ sessions: [] }), { status: 200 })
|
||||
);
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
const getProjectId = vi.fn().mockResolvedValue("project-117");
|
||||
|
||||
await createAgentApiClient("http://agent.local", { getProjectId }).listSessions();
|
||||
|
||||
expect(getProjectId).toHaveBeenCalledOnce();
|
||||
const headers = new Headers(fetchMock.mock.calls[0]?.[1]?.headers);
|
||||
expect(headers.get("X-Project-Id")).toBe("project-117");
|
||||
});
|
||||
|
||||
it("streams session events from the backend SSE endpoint", async () => {
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
|
||||
Reference in New Issue
Block a user