fix(web): search 503 vs error (#34); terms/authorities list error states (#31); authority-tab a11y + dead keys (#32); authority-kind test (#37)
This commit is contained in:
@@ -76,6 +76,20 @@ test("clicking a result shows the object in the detail pane", async () => {
|
||||
expect(await screen.findByText(amphora.object_name)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("a 503 shows the search-unavailable message", async () => {
|
||||
server.use(http.get("/api/admin/search", () => new HttpResponse(null, { status: 503 })));
|
||||
renderApp(tree(), { route: "/search" });
|
||||
await userEvent.type(screen.getByLabelText(/search the collection/i), "bronze");
|
||||
expect(await screen.findByText(/not available on this server/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("a 500 shows the generic search error", async () => {
|
||||
server.use(http.get("/api/admin/search", () => new HttpResponse(null, { status: 500 })));
|
||||
renderApp(tree(), { route: "/search" });
|
||||
await userEvent.type(screen.getByLabelText(/search the collection/i), "bronze");
|
||||
expect(await screen.findByText(/^search is unavailable$/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("hydrates query and visibility from the initial URL", async () => {
|
||||
renderApp(tree(), { route: "/search?q=bronze" });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user