fix: resolve admin issue review findings and record verification
This commit is contained in:
@@ -90,14 +90,12 @@ function renderPage({
|
||||
canManageSecrets = true,
|
||||
onNavigationStateChange,
|
||||
presentation = "legacy",
|
||||
initialWorkspaceId,
|
||||
}: {
|
||||
rows?: CatalogDatabase[] | (() => CatalogDatabase[]);
|
||||
canManage?: boolean;
|
||||
canManageSecrets?: boolean;
|
||||
onNavigationStateChange?: (state: { dirty: boolean; busy: boolean }) => void;
|
||||
presentation?: "legacy" | "fleet";
|
||||
initialWorkspaceId?: string;
|
||||
} = {}) {
|
||||
server.use(http.get("/api/catalog/databases", () => HttpResponse.json(
|
||||
typeof rows === "function" ? rows() : rows,
|
||||
@@ -106,7 +104,6 @@ function renderPage({
|
||||
const view = render(
|
||||
<QueryClientProvider client={client}>
|
||||
<DatabaseManagementPage
|
||||
initialWorkspaceId={initialWorkspaceId}
|
||||
canManage={canManage}
|
||||
canManageSecrets={canManageSecrets}
|
||||
onNavigationStateChange={onNavigationStateChange}
|
||||
@@ -119,7 +116,7 @@ function renderPage({
|
||||
}
|
||||
|
||||
test("fleet entry opens the database list without workspace preparation or an automatic editor", async () => {
|
||||
renderPage({ presentation: "fleet", initialWorkspaceId: "psd-clinical" });
|
||||
renderPage({ presentation: "fleet" });
|
||||
expect(await screen.findByRole("button", { name: "View tables for Policlinico San Donato" })).toBeVisible();
|
||||
expect(screen.getByText("Research laboratory")).toBeVisible();
|
||||
expect(screen.queryByRole("button", { name: "Back to list" })).not.toBeInTheDocument();
|
||||
@@ -127,6 +124,18 @@ test("fleet entry opens the database list without workspace preparation or an au
|
||||
expect(screen.queryByRole("link", { name: "Open workspace preprocessing" })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test.each(["tables", "relationships"])("fresh entry ignores a previously persisted %s screen", async kind => {
|
||||
vi.stubEnv("MODE", "production");
|
||||
localStorage.setItem("thothii:database-management-screen", JSON.stringify({ kind, workspaceId: "psd-clinical" }));
|
||||
try {
|
||||
renderPage({ presentation: "fleet" });
|
||||
expect(await screen.findByRole("button", { name: "View tables for Policlinico San Donato" })).toBeVisible();
|
||||
expect(screen.queryByRole("button", { name: "Back to databases" })).not.toBeInTheDocument();
|
||||
} finally {
|
||||
vi.unstubAllEnvs();
|
||||
}
|
||||
});
|
||||
|
||||
function makeSyncRun(
|
||||
scope: CatalogSyncRun["scope"],
|
||||
tableIds: string[] = [],
|
||||
|
||||
Reference in New Issue
Block a user