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>
16 lines
511 B
JavaScript
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)
|
|
})
|
|
})
|