fix: address administration layout and navigation issues #28 #29 #30 #31

This commit is contained in:
Codex
2026-09-12 18:16:52 +02:00
parent f52bf22e05
commit c7e5f295e6
25 changed files with 286 additions and 90 deletions
@@ -107,7 +107,7 @@ test("starts on the core activity after a hard refresh even if metadata manageme
const sessionNavigation = screen.getByRole("complementary", { name: "Session navigation" });
expect(within(sessionNavigation).getByRole("button", { name: "New session" }))
.toHaveAttribute("aria-current", "page");
expect(within(sessionNavigation).getByRole("button", { name: "Database management" }))
expect(within(sessionNavigation).getByRole("button", { name: "Database" }))
.not.toHaveAttribute("aria-current");
expect(screen.queryByRole("main", { name: "Database management" })).not.toBeInTheDocument();
});
@@ -119,7 +119,7 @@ test("replaces the core conversation while keeping the session navigation", asyn
const conversationColumn = screen.getByTestId("conversation-column");
const sessionNavigation = screen.getByRole("complementary", { name: "Session navigation" });
const newSession = within(sessionNavigation).getByRole("button", { name: "New session" });
const databaseManagement = within(sessionNavigation).getByRole("button", { name: "Database management" });
const databaseManagement = within(sessionNavigation).getByRole("button", { name: "Database" });
expect(newSession).toHaveAttribute("aria-current", "page");
expect(newSession).toHaveAttribute("data-navigation-state", "current");
@@ -178,7 +178,7 @@ test("keeps a live core session connected while returning from database manageme
await waitFor(() => expect(FakeEventSource.instances).toHaveLength(1));
const source = FakeEventSource.instances[0];
await userEvent.click(screen.getByRole("button", { name: "Database management" }));
await userEvent.click(screen.getByRole("button", { name: "Database" }));
expect(screen.getByRole("main", { name: "Database management" })).toBeVisible();
expect(source.closed).toBe(false);
@@ -210,9 +210,9 @@ test("hides the complete administrative navigation from a regular user", () => {
expect(screen.getByRole("button", { name: "New session" })).toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Administration" })).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Workspace management" })).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Database management" })).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Pi management" })).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Workspace" })).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Database" })).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Pi configuration" })).not.toBeInTheDocument();
});
test("requires saving or cancelling a dirty database form before leaving", async () => {
@@ -250,7 +250,8 @@ test("requires saving or cancelling a dirty database form before leaving", async
renderShell();
await expandAdministration();
await userEvent.click(screen.getByRole("button", { name: "Database management" }));
await userEvent.click(screen.getByRole("button", { name: "Database" }));
await userEvent.click(await screen.findByRole("button", { name: "Edit Policlinico San Donato" }));
const schema = await screen.findByLabelText("Schema");
await userEvent.clear(schema);
await userEvent.type(schema, "reporting");