Terminplaner TP2: Entwurfszugriff lesen, GET ohne Dokument, GET-Felder
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
31aa80affd
commit
250fc0c4df
3 files changed
+613
-11
No files matched your search
@@ -246,23 +246,40 @@ test('ohne Pilot (Kunde nicht in der Liste, Modus off) 409 "noch nicht verfuegba
|
||||
assert.equal((await send('GET', einstellungenUrl(), { cookie })).status, 409)
|
||||
})
|
||||
|
||||
test('Funktion aus, noch nicht bestellt oder ohne Dokument: 409 "nicht aktiv"', async () => {
|
||||
test('Funktion aus, noch nicht bestellt oder ohne Dokument: Einstellungen lesen geht (Entwurf), alles andere bleibt 409 "nicht aktiv"', async () => {
|
||||
// Lesen der Einstellungen: in jedem Zustand und auch ohne Dokument (Zustandsmatrix: test/termineFragebogenRoutes.test.js)
|
||||
for (const projectId of ['p2', 'p5']) {
|
||||
const lesen = await send('GET', einstellungenUrl(projectId), { cookie })
|
||||
assert.equal(lesen.status, 200, projectId)
|
||||
assert.equal(lesen.body.state, 'off', projectId)
|
||||
assert.equal(lesen.body.einstellung, null, projectId)
|
||||
assert.equal(lesen.body.version, 0, projectId)
|
||||
// alles andere, auch das Schreiben der Einstellungen (Schreibregeln des Entwurfs folgen in C4b)
|
||||
for (const [method, pfad, body] of [
|
||||
['GET', einstellungenUrl(projectId)],
|
||||
['GET', `/api/termine/buchungen?projectId=${projectId}&von=2026-10-01&bis=2026-10-31`],
|
||||
['GET', `/api/termine/zeiten?projectId=${projectId}`],
|
||||
['GET', `/api/termine/export.csv?projectId=${projectId}`],
|
||||
['POST', '/api/termine/einstellungen/vorlage', { projectId, vorlage: 'salon' }],
|
||||
['PATCH', '/api/termine/einstellungen', { projectId, version: 0, einstellung: {} }],
|
||||
['POST', `/api/termine/ressourcen/${R1}/feed`, { projectId }],
|
||||
['POST', '/api/termine/buchungen', { projectId, art: 'sperre' }],
|
||||
]) {
|
||||
const res = await send(method, pfad, { cookie, body })
|
||||
assert.equal(res.status, 409, `${projectId} ${method} ${pfad}`)
|
||||
assert.equal(res.body.error, 'Der Terminplaner ist für diese Website nicht aktiv.')
|
||||
}
|
||||
}
|
||||
assert.equal(aw.docs('portalFeatures').size, 4, 'p5 hat kein Dokument bekommen (nur die vier aus beforeEach)')
|
||||
for (const state of ['ordered', 'setup']) {
|
||||
aw.seed('portalFeatures', featureDoc({ $id: 'f_p5_termine', projectId: 'p5', state, enabled: false, siteKey: 'efghijklmnopqrst' }))
|
||||
assert.equal((await send('GET', einstellungenUrl('p5'), { cookie })).status, 409, state)
|
||||
const lesen = await send('GET', einstellungenUrl('p5'), { cookie })
|
||||
assert.equal(lesen.status, 200, state)
|
||||
assert.equal(lesen.body.state, state)
|
||||
assert.equal(
|
||||
(await send('GET', `/api/termine/buchungen?projectId=p5&von=2026-10-01&bis=2026-10-31`, { cookie })).status,
|
||||
409,
|
||||
state
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user