Projektarten: Katalog

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-09-30 18:25:27 +00:00
1 parent b98562bb4f
commit a2e308711e
2 files changed
+64

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
import { test } from 'node:test'
import assert from 'node:assert/strict'
import { KINDS, FEATURES, isKind, kindLabel, ticketTypeFor, servicesCatalog } from '../server/services/projectKinds.js'
test('Schlüssel und Labels in fester Reihenfolge', () => {
assert.deepEqual(KINDS.map(k => k.key), ['website', 'webapp', 'app', 'migration', 'automation', 'other'])
assert.deepEqual(KINDS.map(k => k.label), ['Website', 'Web-App', 'App', 'Migration/Umzug', 'Automation/Skript', 'Sonstiges'])
})
test('isKind', () => {
assert.equal(isKind('website'), true)
assert.equal(isKind('shop'), false)
assert.equal(isKind(''), false)
})
test('kindLabel', () => {
assert.equal(kindLabel('migration'), 'Migration/Umzug')
assert.equal(kindLabel('xyz'), '')
})
test('ticketTypeFor', () => {
assert.equal(ticketTypeFor('migration'), 'Migration')
assert.equal(ticketTypeFor('app'), 'Webpage')
})
test('Preview-Werte', () => {
const p = Object.fromEntries(KINDS.map(k => [k.key, k.preview]))
assert.deepEqual(p, { website: 'yes', webapp: 'possible', app: 'no', migration: 'no', automation: 'no', other: 'no' })
})
test('Features nur bei Website', () => {
assert.deepEqual(KINDS.find(k => k.key === 'website').features, ['analyse'])
for (const k of KINDS.filter(k => k.key !== 'website')) assert.deepEqual(k.features, [])
assert.deepEqual(FEATURES.analyse, { label: 'Website-Analyse', status: 'in_development' })
})
test('servicesCatalog und Beschreibungen', () => {
const c = servicesCatalog()
assert.equal(c.kinds, KINDS)
assert.equal(c.features, FEATURES)
for (const k of KINDS) assert.ok(k.description.length > 0)
})