munch-ease-frontend/tests/recipes.api.errors.test.js
2025-11-01 16:59:22 +11:00

12 lines
442 B
JavaScript

import { describe, it, expect } from 'vitest'
import { server, http, HttpResponse } from './test-setup'
import { getRecipe } from '@/api/sdk'
describe('recipes api (errors)', () => {
it('throws on 404 getRecipe', async () => {
server.use(
http.get('*/api/v1/households/:householdSlug/recipes/:id', () => new HttpResponse(null, { status: 404 }))
)
await expect(getRecipe('the-smiths', '999')).rejects.toBeTruthy()
})
})