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'
|
|
|
|
|
|
2025-11-01 06:17:44 +00:00
|
|
|
describe('API household path scoping', () => {
|
|
|
|
|
it('requires household slug in path params', async () => {
|
2025-11-01 02:44:58 +00:00
|
|
|
server.use(
|
2025-11-01 06:17:44 +00:00
|
|
|
http.get('*/api/v1/households/the-smiths/recipes', () => HttpResponse.json({ items: [], total: 0 })),
|
2025-11-01 02:44:58 +00:00
|
|
|
)
|
2025-11-01 06:17:44 +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)
|
|
|
|
|
})
|
|
|
|
|
})
|