fix: return workspace manager to level one

This commit is contained in:
2026-08-14 22:18:12 +02:00
parent c9c30563f2
commit a02ac52836
2 changed files with 28 additions and 12 deletions
+13 -3
View File
@@ -83,14 +83,24 @@ test("uses a tall viewport area and keeps the workspace content scrollable", ()
expect(screen.getByRole("main")).toHaveClass("overflow-y-auto");
});
test("offers an internal link back to the initial page", async () => {
test("offers a button above the workspace list that returns to Level 1", async () => {
const user = userEvent.setup();
const onClose = vi.fn();
renderManager(onClose);
await user.click(screen.getByRole("button", { name: "Back to main page" }));
await user.click(await screen.findByRole("button", { name: "PSD Clinical" }));
expect(await screen.findByRole("heading", { name: "Workspace-specific actions" })).toBeVisible();
expect(onClose).toHaveBeenCalledTimes(1);
const navigation = screen.getByRole("navigation", { name: "Workspaces" });
const backButton = within(navigation).getByRole("button", { name: "Back to main page" });
expect(backButton).toHaveClass("border-border", "bg-card", "w-full");
expect(backButton.compareDocumentPosition(within(navigation).getByText("Available workspaces"))
& Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
await user.click(backButton);
expect(onClose).not.toHaveBeenCalled();
expect(screen.getByTestId("workspace-overview")).toBeVisible();
expect(screen.queryByRole("heading", { name: "Workspace-specific actions" })).not.toBeInTheDocument();
});
test("level one explains the read-only Git sequence and the repository update button", async () => {