24 lines
991 B
TypeScript
24 lines
991 B
TypeScript
|
|
import { describe, it, expect } from 'vitest'
|
||
|
|
|
||
|
|
describe('slug-scoped navigation', () => {
|
||
|
|
it('feature routes are nested under :householdSlug and links use named routes', async () => {
|
||
|
|
const { createAppRouter } = await import('@/router/index')
|
||
|
|
const router = createAppRouter(() => ({}))
|
||
|
|
|
||
|
|
const paths = router.getRoutes().map((r) => r.path)
|
||
|
|
expect(paths).toContain('/:householdSlug/recipes')
|
||
|
|
expect(paths).toContain('/:householdSlug/recipes/:id')
|
||
|
|
expect(paths).toContain('/:householdSlug/mealplan')
|
||
|
|
expect(paths).toContain('/:householdSlug/meals/add')
|
||
|
|
expect(paths).toContain('/:householdSlug/meals/:id')
|
||
|
|
expect(paths).toContain('/:householdSlug/shopping')
|
||
|
|
expect(paths).toContain('/:householdSlug/shopping/current')
|
||
|
|
expect(paths).toContain('/:householdSlug/shopping/:id')
|
||
|
|
|
||
|
|
// No flat feature routes
|
||
|
|
expect(paths).not.toContain('/recipes')
|
||
|
|
expect(paths).not.toContain('/meals/:id')
|
||
|
|
expect(paths).not.toContain('/shopping')
|
||
|
|
})
|
||
|
|
})
|