feat: pin sessions to workspace revisions
This commit is contained in:
@@ -6,16 +6,25 @@ import {
|
||||
deleteSession, getSessionDocuments,
|
||||
} from "./sessions";
|
||||
|
||||
test("createSession POSTs only {question} and returns the id", async () => {
|
||||
test("createSession migrates legacy selections and POSTs browser preferences", async () => {
|
||||
localStorage.clear();
|
||||
let body: unknown = null;
|
||||
server.use(
|
||||
http.get("http://localhost:8787/settings", () => HttpResponse.json({
|
||||
workspace: "psd-clinical", provider: "zai", model: "glm-5.2", thinking: "low",
|
||||
})),
|
||||
http.post("http://localhost:8787/sessions", async ({ request }) => {
|
||||
body = await request.json();
|
||||
return HttpResponse.json({ id: "s1" });
|
||||
}),
|
||||
);
|
||||
expect(await createSession({ question: "q" })).toEqual({ id: "s1" });
|
||||
expect(body).toEqual({ question: "q" });
|
||||
expect(body).toEqual({
|
||||
question: "q", workspaceId: "psd-clinical", provider: "zai", model: "glm-5.2", thinking: "low",
|
||||
});
|
||||
expect(JSON.parse(localStorage.getItem("thothii.workspace-registry.v1.preferences")!)).toEqual({
|
||||
workspaceId: "psd-clinical", provider: "zai", model: "glm-5.2", thinking: "low",
|
||||
});
|
||||
});
|
||||
|
||||
test.each([202, 204])("prewarmRuntime accepts a body-less %s response", async (status) => {
|
||||
|
||||
Reference in New Issue
Block a user