feat(server): Standardwerte für Node, Storage und Bridge
Der Server kannte die Standards schon für kurze CLI-Befehle, aber nichts setzte sie. Jetzt im Server-Formular (Auswahl aus dem Verbindungstest) und als Vorbelegung im Assistenten. Closes #023 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,27 @@ describe.runIf(datenbankVerfuegbar)("Server-Verwaltung", () => {
|
||||
expect(alles).not.toContain(MOCK_TOKEN_GEHEIMNIS);
|
||||
});
|
||||
|
||||
it("Standardwerte: gespeichert, leere Felder fallen weg, ganz leer ist null", async () => {
|
||||
await liste.POST(anfrage("POST", "/api/v1/server", admin, eingabe()));
|
||||
const setzen = async (standards: unknown) =>
|
||||
await (
|
||||
await einzeln.PATCH(
|
||||
anfrage("PATCH", "/api/v1/server/rz1", admin, eingabe({ tokenGeheimnis: "", standards })),
|
||||
kontext({ name: "rz1" }),
|
||||
)
|
||||
).json();
|
||||
expect((await setzen({ knoten: "pve01", storage: " local-zfs ", bridge: "" })).standards).toEqual({
|
||||
knoten: "pve01",
|
||||
storage: "local-zfs",
|
||||
});
|
||||
expect((await testPrisma.server.findFirstOrThrow()).standards).toEqual({
|
||||
knoten: "pve01",
|
||||
storage: "local-zfs",
|
||||
});
|
||||
expect((await setzen({ knoten: "", storage: "", bridge: "" })).standards).toBeNull();
|
||||
expect((await testPrisma.server.findFirstOrThrow()).standards).toBeNull();
|
||||
});
|
||||
|
||||
it("löscht und protokolliert", async () => {
|
||||
await liste.POST(anfrage("POST", "/api/v1/server", admin, eingabe()));
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user