Files
social-graph/frontend/src/lib/api/errors.test.js
T
gitrusprusandCursor b668ee8507 Add network map UX and theme support.
Introduce network map view/components with filtering and positioning, expand contacts/map backend fields and migrations, and add a persistent light/dark theme toggle with graph label color updates for readability.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 13:24:48 +03:00

16 lines
511 B
JavaScript

import { describe, it, expect } from 'vitest'
import { normalizeApiError } from './errors'
describe('normalizeApiError', () => {
it('extracts API message from response payload', () => {
const err = normalizeApiError({ response: { status: 400, data: { error: 'Bad request' } } })
expect(err.message).toBe('Bad request')
expect(err.status).toBe(400)
})
it('falls back to generic message', () => {
const err = normalizeApiError({})
expect(err.message.length).toBeGreaterThan(0)
})
})