munch-ease-frontend/tests/household.header.test.ts

14 lines
567 B
TypeScript
Raw Normal View History

2025-11-01 02:44:58 +00:00
import { describe, it, expect } from 'vitest'
import { server, http, HttpResponse } from './test-setup'
import { api } from '@/api/client'
describe('API household path scoping', () => {
it('requires household slug in path params', async () => {
2025-11-01 02:44:58 +00:00
server.use(
http.get('*/api/v1/households/the-smiths/recipes', () => HttpResponse.json({ items: [], total: 0 })),
2025-11-01 02:44:58 +00:00
)
const res = await api.GET('/api/v1/households/{householdSlug}/recipes', { params: { path: { householdSlug: 'the-smiths' }, query: {} } })
2025-11-01 02:44:58 +00:00
expect(res.response.ok).toBe(true)
})
})