feat(katalog): Profil-Editor mit Live-Prüfung und Skriptvorschau

Admins legen eigene Profile als YAML an; geprüft wird beim Tippen gegen
dasselbe Schema wie der Katalog, dazu eine Vorschau des erzeugten
Skripts. Katalogprofile bleiben schreibgeschützt und lassen sich als
Kopie bearbeiten. Ein Profil, das ein anderes voraussetzt, lässt sich
nicht löschen.

Closes #011

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 13:44:28 +02:00
co-authored by Claude Opus 5.5
parent d25ec54ef9
commit e4306a6a53
11 changed files with 529 additions and 14 deletions
+38
View File
@@ -0,0 +1,38 @@
import { expect, test } from "@playwright/test";
import { anmelden, E2E_PRAEFIX, keinQuerscrollen } from "./helfer";
test("Profil-Editor: Kopie eines Katalogprofils, Live-Prüfung, speichern, löschen", async ({ page }) => {
const id = `${E2E_PRAEFIX}-${test.info().project.name}`;
await anmelden(page, "/katalog/profile/docker");
await expect(page.getByText("Katalog (schreibgeschützt)")).toBeVisible();
await expect(page.getByLabel("Profil als YAML")).not.toBeEditable();
await page.getByRole("link", { name: "Als Kopie bearbeiten" }).click();
await expect(page).toHaveURL(/\/katalog\/profile\/neu\?von=docker/);
const editor = page.getByLabel("Profil als YAML");
await editor.fill(
(await editor.inputValue())
.replace("id: docker-eigen", `id: ${id}`)
.replace("- packages: [", "- pakete: ["),
);
await expect(page.getByText(/families\.debian\.1/)).toBeVisible();
await expect(page.getByRole("button", { name: "Speichern" })).toBeDisabled();
await editor.fill((await editor.inputValue()).replace("- pakete: [", "- packages: ["));
await expect(page.getByText("Gültig", { exact: true })).toBeVisible();
await page.getByText("Vorschau: erzeugtes Skript").click();
await expect(page.getByText(/docker-compose-plugin/).first()).toBeVisible();
await keinQuerscrollen(page);
await page.screenshot({
path: `test-results/profil-editor-${test.info().project.name}.png`,
fullPage: true,
});
await page.getByRole("button", { name: "Speichern" }).click();
await expect(page).toHaveURL(new RegExp(`/katalog/profile/${id}$`));
await expect(page.getByText("eigenes Profil")).toBeVisible();
page.once("dialog", (d) => void d.accept());
await page.getByRole("button", { name: "Löschen" }).click();
await expect(page).toHaveURL(/\/katalog$/);
});