feat: pin sessions to workspace revisions
This commit is contained in:
@@ -8,6 +8,7 @@ import { useSessionStore } from "../store/sessionStore";
|
||||
import { ComposerFooter, ContextGauge, SteerInput } from "./SteerInput";
|
||||
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
server.use(
|
||||
http.post("http://localhost:8787/sessions/:id/steer", () =>
|
||||
new HttpResponse(null, { status: 204 }),
|
||||
@@ -15,6 +16,25 @@ beforeEach(() => {
|
||||
);
|
||||
});
|
||||
|
||||
test("new sessions send the browser-selected workspace, model, provider, and thinking", async () => {
|
||||
let body: unknown;
|
||||
localStorage.setItem("thothii.workspace-registry.v1.preferences", JSON.stringify({
|
||||
workspaceId: "psd-clinical", provider: "zai", model: "glm-5.2", thinking: "high",
|
||||
}));
|
||||
server.use(http.post("http://localhost:8787/sessions", async ({ request }) => {
|
||||
body = await request.json();
|
||||
return HttpResponse.json({ id: "s1" });
|
||||
}));
|
||||
render(<SteerInput sessionId={null} />);
|
||||
|
||||
await userEvent.type(screen.getByRole("textbox", { name: /new question/i }), "q");
|
||||
await userEvent.click(screen.getByRole("button", { name: /send/i }));
|
||||
|
||||
await waitFor(() => expect(body).toEqual({
|
||||
question: "q", workspaceId: "psd-clinical", provider: "zai", model: "glm-5.2", thinking: "high",
|
||||
}));
|
||||
});
|
||||
|
||||
test("renders a text input and submit button", () => {
|
||||
render(<SteerInput sessionId="s1" />);
|
||||
expect(screen.getByRole("textbox")).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user