Analyse: Lesezugriff fuer WOMS

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-01 10:37:25 +00:00
1 parent 821e947275
commit 0b59dac2be
4 files changed
+91 -4

No files matched your search

+21 -1
View File
@@ -18,6 +18,7 @@ before(async () => {
],
workorders: [{ $id: 't1', woid: '100115', customerId: 'c1', status: 'Open' }],
customers: [{ $id: 'c1', name: 'Döner Nation' }],
portalFeatures: [{ $id: 'f1', customerId: 'c1', projectId: 'p1', featureKey: 'analyse', state: 'active' }],
},
})
Object.assign(process.env, { APPWRITE_ENDPOINT: aw.endpoint, APPWRITE_API_KEY: 'test-key' })
@@ -53,10 +54,29 @@ test('Katalog + Gruppen, Archiv/Vorlage ausgeschlossen, Namen aufgelöst', async
assert.deepEqual(body.groups.website[0], {
id: 'p1', projectName: 'Doener', repoFullName: 'JUSN/doener', customerId: 'c1',
customerName: 'Döner Nation', ticketId: 't1', woid: '100115',
previewUrl: 'https://doener.project.webklar.com', previewState: '', features: {},
previewUrl: 'https://doener.project.webklar.com', previewState: '', features: { analyse: 'active' },
})
assert.equal(body.groups.missing[0].previewUrl, 'https://ohne.de')
assert.equal(body.groups.missing[0].customerName, '')
const all = Object.values(body.groups).flat().map((p) => p.id)
assert.ok(!all.includes('p3') && !all.includes('p4'))
})
test('Analyse: features.analyse je Projekt, Katalogstatus folgt ANALYSE_ENABLED', async () => {
const { config } = await import('../server/config.js')
const was = config.analyse.enabled
try {
config.analyse.enabled = false
let body = await (await get('jwt-admin')).json()
assert.equal(body.features.analyse.status, 'in_development')
config.analyse.enabled = true
body = await (await get('jwt-admin')).json()
assert.equal(body.features.analyse.status, 'available')
assert.equal(body.groups.website[0].features.analyse, 'active')
assert.equal(body.groups.missing[0].features.analyse, null)
} finally {
config.analyse.enabled = was
}
const { FEATURES } = await import('../server/services/projectKinds.js')
assert.equal(FEATURES.analyse.status, 'in_development')
})