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') }) })