test: Benachrichtigungen end-to-end und in der Datenbank absichern
Die Einstellung haelt ueber das Neuladen, ohne eingeschalteten Weg geht nichts hinaus, und ein unsinniger Vorlauf wird auch dann abgewiesen, wenn er an der Oberflaeche vorbei hereinkommt. Der Anmeldehelfer liegt jetzt einmal in e2e/hilfe.ts und fasst nach: ein Klick, der vor der Hydratation ankommt, verpufft folgenlos — das hat die Testlaeufe unter Last wiederholt scheitern lassen. Der Integrationstest prueft die drei neuen Tabellen samt Kaskade. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f03ea73dcd
commit
6e1f2791cd
+4
-14
@@ -1,6 +1,7 @@
|
||||
import { PrismaPg } from '@prisma/adapter-pg'
|
||||
import { expect, test, type Page } from '@playwright/test'
|
||||
import { expect, test } from '@playwright/test'
|
||||
import { PrismaClient } from '../src/generated/prisma/client.js'
|
||||
import { anmelden, EMAIL, PASSWORT, VERBINDUNG } from './hilfe'
|
||||
|
||||
/**
|
||||
* Wochenansicht und Zeitblöcke.
|
||||
@@ -11,16 +12,13 @@ import { PrismaClient } from '../src/generated/prisma/client.js'
|
||||
* Kalender nicht erreichbar ist.
|
||||
*/
|
||||
|
||||
const EMAIL = process.env.ADMIN_EMAIL ?? ''
|
||||
const PASSWORT = process.env.ADMIN_PASSWORT ?? ''
|
||||
const PRAEFIX = `E2E-W-${Date.now()}`
|
||||
|
||||
const verbindung = process.env.DATABASE_URL ?? ''
|
||||
const db = new PrismaClient({ adapter: new PrismaPg({ connectionString: verbindung }) })
|
||||
const db = new PrismaClient({ adapter: new PrismaPg({ connectionString: VERBINDUNG }) })
|
||||
|
||||
test.describe('Woche', () => {
|
||||
test.skip(
|
||||
!EMAIL || !PASSWORT || !verbindung,
|
||||
!EMAIL || !PASSWORT || !VERBINDUNG,
|
||||
'Ohne ADMIN_EMAIL, ADMIN_PASSWORT und DATABASE_URL gibt es kein Testkonto.',
|
||||
)
|
||||
|
||||
@@ -34,14 +32,6 @@ test.describe('Woche', () => {
|
||||
await db.$disconnect()
|
||||
})
|
||||
|
||||
async function anmelden(seite: Page): Promise<void> {
|
||||
await seite.goto('/anmelden')
|
||||
await seite.getByLabel('E-Mail-Adresse').fill(EMAIL)
|
||||
await seite.getByLabel('Passwort').fill(PASSWORT)
|
||||
await seite.getByRole('button', { name: 'Mit Passwort anmelden' }).click()
|
||||
await expect(seite.getByRole('heading', { name: /Guten Tag/ })).toBeVisible()
|
||||
}
|
||||
|
||||
test('weist ohne verbundenen Kalender darauf hin', async ({ page }) => {
|
||||
await db.kalenderkonto.deleteMany({})
|
||||
await anmelden(page)
|
||||
|
||||
Reference in New Issue
Block a user