fix: surface reviewer response failures

This commit is contained in:
2026-08-14 12:06:25 +02:00
parent 25b2835e73
commit db1a81cfa6
8 changed files with 166 additions and 3 deletions
@@ -0,0 +1,28 @@
import { act, render, screen } from "@testing-library/react";
import { http, HttpResponse } from "msw";
import { App } from "../App";
import { queryClient } from "../app/queryClient";
import { useSessionStore } from "../store/sessionStore";
import { server } from "../test/msw";
beforeEach(() => {
queryClient.clear();
useSessionStore.getState().resetSession();
server.use(
http.get("/api/me", () => HttpResponse.json({ issuer: "local", subject: "dev", isAdmin: true })),
http.get("/api/sessions", () => HttpResponse.json([])),
http.get("/api/settings", () => HttpResponse.json({ workspace: "psd-clinical" })),
http.get("/api/workspaces", () => HttpResponse.json([])),
http.get("/api/models", () => HttpResponse.json({ models: [] })),
);
});
test("session errors queued in the store become visible notifications", async () => {
render(<App />);
act(() => useSessionStore.getState().pushToast({
level: "error",
text: "The selected model is unavailable for this subscription.",
}));
expect(await screen.findByText("The selected model is unavailable for this subscription.")).toBeInTheDocument();
});