Subdomain-Vorschlag und Zuweisungs-Logik mit Tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-09-30 10:41:35 +00:00
1 parent c24b3d43c8
commit cc59e7978e
6 files changed
+174 -1

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { loadModule } from './load.mjs'
const { suggestSubdomain } = await loadModule('src/lib/subdomain.js')
test('Kundenname vor Projektname', () => {
assert.equal(suggestSubdomain('Döner Nation', 'D-ner-Nation'), 'doener-nation')
})
test('Apostroph', () => {
assert.equal(suggestSubdomain("Emma's Schatzkiste", ''), 'emmas-schatzkiste')
})
test('Sonderzeichen', () => {
assert.equal(suggestSubdomain('', 'Café Müller & Söhne + Straße'), 'cafe-mueller-soehne-strasse')
})
test('leer', () => {
assert.equal(suggestSubdomain('', ''), '')
})
test('63 Zeichen ohne Bindestrich am Ende', () => {
assert.equal(suggestSubdomain('a'.repeat(62) + ' b', ''), 'a'.repeat(62))
})