Version 1.0.0 — Freigabe für den Echtbetrieb (#17)
Pruefung / pruefung (push) Canceled after 0s
Pruefung / oberflaeche (push) Canceled after 0s

This commit was merged in pull request #17.
This commit is contained in:
2026-09-06 20:08:16 +00:00
parent 14cc4de9b8
commit 3b20abcb23
11 changed files with 799 additions and 30 deletions
+19 -7
View File
@@ -43,6 +43,15 @@ beforeAll(async () => {
return;
}
// Erst aufraeumen, dann anlegen.
//
// Aufraeumen nur am Ende reicht nicht: bricht ein Lauf ab — abgebrochene
// Sitzung, Fehler in einer anderen Datei, geschlossenes Terminal —, bleiben
// die Datensaetze stehen und der naechste Lauf scheitert an einer
// Eindeutigkeit, die mit dem Geprueften nichts zu tun hat. Das kostet dann
// zehn Minuten Fehlersuche an der falschen Stelle.
await aufraeumen();
const a = await system.organisation.upsert({
where: { slug: SLUG_A },
update: {},
@@ -91,14 +100,17 @@ beforeAll(async () => {
konto = benutzer.id;
});
/** Alles entfernen, was dieser Test anlegt. */
async function aufraeumen(): Promise<void> {
await system.$transaction(async (tx) => {
await tx.$executeRaw`SELECT set_config('app.audit_bereinigung', 'an', true)`;
await tx.benutzer.deleteMany({ where: { email: { endsWith: "@test-mandant.de" } } });
await tx.organisation.deleteMany({ where: { slug: { in: [SLUG_A, SLUG_B] } } });
});
}
afterAll(async () => {
if (erreichbar) {
await system.$transaction(async (tx) => {
await tx.$executeRaw`SELECT set_config('app.audit_bereinigung', 'an', true)`;
await tx.benutzer.deleteMany({ where: { email: { endsWith: "@test-mandant.de" } } });
await tx.organisation.deleteMany({ where: { slug: { in: [SLUG_A, SLUG_B] } } });
});
}
if (erreichbar) await aufraeumen();
await system.$disconnect();
});