22 lines
965 B
TypeScript
22 lines
965 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
|
|
describe('router slugged routing', () => {
|
|
it('includes public routes and only slugged feature routes', async () => {
|
|
const { createAppRouter } = await import('@/router/index')
|
|
const router = createAppRouter(() => null)
|
|
const paths = router.getRoutes().map((r) => r.path)
|
|
expect(paths).toContain('/login')
|
|
expect(paths).toContain('/create-account')
|
|
expect(paths).toContain('/welcome')
|
|
expect(paths).toContain('/invitations/accept')
|
|
// Only slugged feature routes
|
|
expect(paths).toContain('/:householdSlug/recipes')
|
|
expect(paths).toContain('/:householdSlug/mealplan')
|
|
expect(paths).toContain('/:householdSlug/shopping')
|
|
expect(paths).toContain('/:householdSlug/shopping/current')
|
|
expect(paths).toContain('/:householdSlug/settings/members')
|
|
// No legacy flat routes
|
|
expect(paths).not.toContain('/recipes')
|
|
expect(paths).not.toContain('/shopping')
|
|
})
|
|
})
|