Buchungskalender: Abschluss – Kleinigkeiten Server (Betrag/Waehrung, Erstattungs-Webhook, Obergrenze, Zaehler, Cache, Kommentare, Setup-Check)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d35674c1e
commit
1d9515823c
13 files changed
+123
-14
No files matched your search
@@ -209,6 +209,13 @@ test('Anfrage: mehr als anfragenJeSiteStunde je Seite -> 429', async () => {
|
||||
assert.equal(aw.docs('ukAnfragen').size, 2)
|
||||
})
|
||||
|
||||
test('Anfrage: fehlerhafte Felder (Datum, Unterkunft) verbrauchen das Stundenkontingent der Seite nicht', async () => {
|
||||
config.unterkunft.anfragenJeSiteStunde = 1
|
||||
for (const extra of [{ von: 'morgen' }, { bis: '' }, { unterkunft: 'a/b' }]) assert.equal((await post(anfrage(extra))).status, 400)
|
||||
assert.equal((await post(anfrage({ von: '2026-11-10', bis: '2026-11-12' }))).status, 201)
|
||||
assert.equal((await post(anfrage({ von: '2026-12-10', bis: '2026-12-12' }))).status, 429)
|
||||
})
|
||||
|
||||
test('CORS: Preflight erlaubt/fremd, POST von fremder oder fehlender Origin -> 403', async () => {
|
||||
const ok = await send('OPTIONS', `${BASE}/anfrage`, { headers: { origin: ORIGIN, 'access-control-request-method': 'POST' } })
|
||||
assert.equal(ok.status, 204)
|
||||
|
||||
Reference in new issue
Block a user