b90ff252d1
Public archive with sidebar navigation, project pages, month archive, search and entry pages with image blocks. Admin area for brands, projects, post types, users, api clients, media and the entry editor with drag and drop images, preview per audience, scheduling and publish checks. Read and write API with bearer tokens, audience scoping, idempotent creation, OpenAPI document and editorial guide. Magic link login with configurable allowed domains, whole app behind the session gate. 456 tests including design rule checks.
24 lines
913 B
TypeScript
24 lines
913 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { monthPath, overviewPath, postPath, projectPath, searchPath, yearPath } from '~/lib/routes'
|
|
|
|
describe('routes', () => {
|
|
it('lässt Seite eins aus der Adresse weg', () => {
|
|
expect(overviewPath()).toBe('/')
|
|
expect(overviewPath({ page: 1 })).toBe('/')
|
|
expect(overviewPath({ page: 2 })).toBe('/?page=2')
|
|
expect(projectPath('trakk', { page: 3 })).toBe('/trakk?page=3')
|
|
})
|
|
|
|
it('schreibt Monate zweistellig', () => {
|
|
expect(overviewPath({ year: 2026, month: 7 })).toBe('/?year=2026&month=07')
|
|
expect(monthPath('trakk', 2026, 7)).toBe('/trakk/2026/07')
|
|
expect(yearPath('trakk', 2026)).toBe('/trakk/2026')
|
|
})
|
|
|
|
it('maskiert Slugs und Suchbegriffe', () => {
|
|
expect(postPath('mta 360', 'a/b')).toBe('/mta%20360/a%2Fb')
|
|
expect(searchPath({ query: 'spalten menü' })).toBe('/search?q=spalten+men%C3%BC')
|
|
expect(searchPath()).toBe('/search')
|
|
})
|
|
})
|