13 lines
407 B
JavaScript
13 lines
407 B
JavaScript
|
|
import { describe, it, expect } from 'vitest'
|
||
|
|
import { server, http, HttpResponse } from './test-setup'
|
||
|
|
import { getPersonsInHome } from '@/api/sdk'
|
||
|
|
|
||
|
|
describe('persons api errors', () => {
|
||
|
|
it('propagates non-2xx errors', async () => {
|
||
|
|
server.use(
|
||
|
|
http.get('*/api/v1/persons', () => new HttpResponse(null, { status: 422 }))
|
||
|
|
)
|
||
|
|
await expect(getPersonsInHome()).rejects.toBeTruthy()
|
||
|
|
})
|
||
|
|
})
|