fix: surface reviewer response failures
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user