feat(schnellstart): Kacheln je Geraetetyp in der Oberflaeche pflegen (#44)
This commit was merged in pull request #44.
This commit is contained in:
@@ -414,6 +414,36 @@ describe.runIf(datenbankVerfuegbar)("Seed gegen die Datenbank", () => {
|
||||
expect(await typVorgabenSaeen(testPrisma, gesaet)).toBe(0);
|
||||
});
|
||||
|
||||
it("laesst den Schnellstart in Ruhe, sobald er in der Oberflaeche gepflegt wurde", async () => {
|
||||
// Der Fall aus #022: wer eine Kachel entfernt, soll sie nicht beim naechsten
|
||||
// Seed-Lauf zurueckbekommen. Eine fehlende Zeile sagt nicht, ob sie noch nie
|
||||
// da war oder bewusst entfernt wurde — die Marke sagt es.
|
||||
const gesaet = await vorlagenSaeen(testPrisma);
|
||||
expect(await typVorgabenSaeen(testPrisma, gesaet)).toBeGreaterThan(0);
|
||||
|
||||
await testPrisma.geraetetypVorlage.deleteMany({ where: { geraeteTyp: GeraeteTyp.PC } });
|
||||
// upsert, weil dieser Block die Einstellung nicht selbst anlegt - und genau
|
||||
// deshalb belegt der Test auch, dass typVorgabenSaeen ohne sie zurechtkommt.
|
||||
await testPrisma.einstellung.upsert({
|
||||
where: { id: "global" },
|
||||
create: { id: "global", schnellstartGepflegt: true },
|
||||
update: { schnellstartGepflegt: true },
|
||||
});
|
||||
|
||||
expect(await typVorgabenSaeen(testPrisma, gesaet)).toBe(0);
|
||||
expect(await testPrisma.geraetetypVorlage.count({ where: { geraeteTyp: GeraeteTyp.PC } })).toBe(0);
|
||||
});
|
||||
|
||||
it("legt die Vorgaben weiter an, solange niemand sie gepflegt hat", async () => {
|
||||
const gesaet = await vorlagenSaeen(testPrisma);
|
||||
await typVorgabenSaeen(testPrisma, gesaet);
|
||||
const vorher = await testPrisma.geraetetypVorlage.count({ where: { geraeteTyp: GeraeteTyp.PC } });
|
||||
expect(vorher).toBeGreaterThan(0);
|
||||
|
||||
await testPrisma.geraetetypVorlage.deleteMany({ where: { geraeteTyp: GeraeteTyp.PC } });
|
||||
expect(await typVorgabenSaeen(testPrisma, gesaet)).toBe(vorher);
|
||||
});
|
||||
|
||||
it("legt Abteilungen, Personen, Geraete und freie Tags an", async () => {
|
||||
const eigene = await eigeneOrganisation();
|
||||
const bestand = await stammdatenSaeen(testPrisma, eigene.id);
|
||||
|
||||
Reference in New Issue
Block a user