From 7c34d859b48a63817fd016202d1a93ebfb9c7e9a Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Sun, 5 Jul 2026 01:54:46 -0700 Subject: [PATCH] test(sdk): update stale send() vitest expectations to the path-keyed contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three server.test.ts / server-attachments.test.ts cases still asserted the pre-verb-lift send shape (POST /v1/api/send with ws_id in the body). The server route has been POST /v1/api/workstreams/{ws_id}/send (ws_id in the path, {message} body) since that lift, and the SDK send() was updated with it — only these expectations rotted. They fail on main too; unrelated to approvals, folded in here to leave the TS SDK suite green. Test-only, no SDK source change. --- sdk/typescript/tests/server-attachments.test.ts | 3 +-- sdk/typescript/tests/server.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/typescript/tests/server-attachments.test.ts b/sdk/typescript/tests/server-attachments.test.ts index 5c28baac..068175b6 100644 --- a/sdk/typescript/tests/server-attachments.test.ts +++ b/sdk/typescript/tests/server-attachments.test.ts @@ -104,7 +104,6 @@ describe("TurnstoneServer attachments", () => { const [, init] = (fetchFn as ReturnType).mock.calls[0]; expect(JSON.parse(init.body)).toEqual({ message: "hi", - ws_id: "ws-X", attachment_ids: ["a1", "a2"], }); }); @@ -117,7 +116,7 @@ describe("TurnstoneServer attachments", () => { }); await client.send("hi", "ws-X"); const [, init] = (fetchFn as ReturnType).mock.calls[0]; - expect(JSON.parse(init.body)).toEqual({ message: "hi", ws_id: "ws-X" }); + expect(JSON.parse(init.body)).toEqual({ message: "hi" }); }); it("createWorkstream with attachments sends multipart and auto-generates ws_id", async () => { diff --git a/sdk/typescript/tests/server.test.ts b/sdk/typescript/tests/server.test.ts index 58330b5e..66d201ae 100644 --- a/sdk/typescript/tests/server.test.ts +++ b/sdk/typescript/tests/server.test.ts @@ -74,8 +74,8 @@ describe("TurnstoneServer", () => { await client.send("Hello", "ws1"); const [url, init] = (fetchFn as ReturnType).mock.calls[0]; - expect(url).toBe("http://test/v1/api/send"); - expect(JSON.parse(init.body)).toEqual({ message: "Hello", ws_id: "ws1" }); + expect(url).toBe("http://test/v1/api/workstreams/ws1/send"); + expect(JSON.parse(init.body)).toEqual({ message: "Hello" }); }); it("injects auth header when token provided", async () => {