Bausteine: slugify mit Umlauten, deutsche Zeit, Sperren
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a3faa1aff1
commit
679f996597
6 files changed
+144
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { slugify } from '../server/services/slug.js'
|
||||
|
||||
test('Umlaute', () => {
|
||||
assert.equal(slugify('Döner Nation'), 'doener-nation')
|
||||
assert.equal(slugify('Größe Überall Ärger'), 'groesse-ueberall-aerger')
|
||||
})
|
||||
test('Apostrophe entfallen', () => {
|
||||
assert.equal(slugify("Emma's Schatzkiste"), 'emmas-schatzkiste')
|
||||
assert.equal(slugify('Emma’s'), 'emmas')
|
||||
})
|
||||
test('Akzente', () => assert.equal(slugify('Café Élan'), 'cafe-elan'))
|
||||
test('Sonderzeichen, Ränder, Länge', () => {
|
||||
assert.equal(slugify('--A&B--'), 'a-b')
|
||||
assert.equal(slugify('x'.repeat(150)).length, 100)
|
||||
assert.equal(slugify(null), '')
|
||||
})
|
||||
Reference in new issue
Block a user