Buchungskalender: Abgleich – art monteurzimmer, Zurückziehen-409 mit Meldung, Tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Opus 5.5 committed 2026-10-07 14:53:13 +00:00
1 parent 54442a4682
commit f01e6def59
2 files changed
+32 -4

No files matched your search

+26
View File
@@ -731,6 +731,32 @@ test('Anfragekarte: offen mit Zurückziehen, abgelehnt mit Begründung als Text'
})()
})
test('Anfrageformular sendet monteurzimmer; ein vorhandenes monteur wird als Monteurwohnung gewaehlt', async () => {
await mit(() => ({ body: { anfrage: { status: 'offen' } } }), async (fx) => {
const wurzel = h('div')
fx.document.body.append(wurzel)
renderAnfrageFormular(wurzel, { projectId: 'p1', vorgabe: { art: 'monteur', einheiten: 2, portale: [], nachricht: '' }, nachSenden: async () => {} })
assert.equal(fx.finde(wurzel, '[data-feld="art"]').value, 'monteurzimmer')
await fx.setze(fx.finde(wurzel, '[data-feld="einheiten"]'), '2')
await fx.klick(fx.finde(wurzel, '[data-aktion="anfrage-senden"]'))
await fx.ruhe()
assert.equal(posts(fx).at(-1).body.art, 'monteurzimmer')
})()
})
test('Zurückziehen 409: Stand wird mit der Meldung neu geladen', async () => {
await mit((a) => (a.url.includes('zurueckziehen') ? { status: 409, body: { fehler: 'status_ungueltig', error: 'Die Anfrage wurde schon bearbeitet.' } } : { body: {} }), async (fx) => {
const gesehen = []
const k = anfrageKarte({ status: 'offen', at: '2026-10-07T10:00:00Z', anfrage: { art: 'pension' } }, { projectId: 'p1', neuLaden: async (o) => { gesehen.push(o) } })
fx.document.body.append(k)
await fx.klick(fx.finde(k, '[data-aktion="zurueckziehen"]'))
await fx.ruhe()
assert.equal(gesehen.length, 1)
assert.equal(typeof gesehen[0]?.meldung, 'string')
assert.ok(gesehen[0].meldung.length > 0)
})()
})
test('Ansicht #buchungen: Zustand off zeigt das Anfrageformular, Projekt vom Wunsch-Attribut', async () => {
vergissAuswahl()
await mit((a) => {