Kaynağa Gözat

test(session): cover workspace-routed messages (#26576)

Kit Langton 4 ay önce
ebeveyn
işleme
8602937a37

+ 7 - 0
packages/opencode/test/server/httpapi-session.test.ts

@@ -364,8 +364,15 @@ describe("session HttpApi", () => {
           headers: { "x-opencode-directory": tmp.path, "content-type": "application/json" },
           headers: { "x-opencode-directory": tmp.path, "content-type": "application/json" },
           body: JSON.stringify({ title: "workspace session" }),
           body: JSON.stringify({ title: "workspace session" }),
         })
         })
+        const messages = yield* request(
+          `${pathFor(SessionPaths.messages, { sessionID: created.id })}?workspace=${workspace.id}`,
+          {
+            headers: { "x-opencode-directory": tmp.path },
+          },
+        )
 
 
         expect(created).toMatchObject({ id: created.id, workspaceID: workspace.id })
         expect(created).toMatchObject({ id: created.id, workspaceID: workspace.id })
+        expect(messages.status).toBe(200)
         expect(
         expect(
           yield* Effect.sync(() =>
           yield* Effect.sync(() =>
             Database.use((db) =>
             Database.use((db) =>