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:
@@ -33,7 +33,7 @@ test("lists authorities for the kind and creates one", async () => {
|
||||
|
||||
test("kind tabs link to the other kinds", async () => {
|
||||
renderApp(tree(), { route: "/authorities/person" });
|
||||
expect(await screen.findByRole("link", { name: /place/i })).toHaveAttribute("href", "/authorities/place");
|
||||
expect(await screen.findByRole("tab", { name: /place/i })).toHaveAttribute("href", "/authorities/place");
|
||||
});
|
||||
|
||||
test("create without EN label shows required alert and does not POST", async () => {
|
||||
@@ -51,6 +51,14 @@ test("create without EN label shows required alert and does not POST", async ()
|
||||
expect(posted).toBe(false);
|
||||
});
|
||||
|
||||
test("authorities endpoint error shows loadError", async () => {
|
||||
server.use(
|
||||
http.get("/api/admin/authorities", () => new HttpResponse(null, { status: 500 })),
|
||||
);
|
||||
renderApp(tree(), { route: "/authorities/person" });
|
||||
expect(await screen.findByText(/could not load/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("unknown kind redirects to person list", async () => {
|
||||
renderApp(tree(), { route: "/authorities/banana" });
|
||||
expect(await screen.findByText("Ada Lovelace")).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user