import { describe, test, expect } from 'vitest' import { getCalloutColors } from '../../lib/editor/callout-colors' describe('getCalloutColors', () => { test('returns correct colors for each known type', () => { expect(getCalloutColors('info')).toEqual({ bg: '#eff6ff', border: '#93c5fd' }) expect(getCalloutColors('warning')).toEqual({ bg: '#fffbeb', border: '#fcd34d' }) expect(getCalloutColors('tip')).toEqual({ bg: '#faf5ff', border: '#c4b5fd' }) expect(getCalloutColors('success')).toEqual({ bg: '#f0fdf4', border: '#86efac' }) expect(getCalloutColors('danger')).toEqual({ bg: '#fef2f2', border: '#fca5a5' }) }) test('falls back to info for null', () => { expect(getCalloutColors(null)).toEqual({ bg: '#eff6ff', border: '#93c5fd' }) }) test('falls back to info for undefined', () => { expect(getCalloutColors(undefined)).toEqual({ bg: '#eff6ff', border: '#93c5fd' }) }) test('falls back to info for unknown type', () => { expect(getCalloutColors('unknown')).toEqual({ bg: '#eff6ff', border: '#93c5fd' }) expect(getCalloutColors('')).toEqual({ bg: '#eff6ff', border: '#93c5fd' }) }) test('returned object always has bg and border as strings', () => { const types = ['info', 'warning', 'tip', 'success', 'danger', null, undefined, 'unknown'] for (const t of types) { const c = getCalloutColors(t) expect(typeof c.bg).toBe('string') expect(typeof c.border).toBe('string') expect(c.bg.length).toBeGreaterThan(0) expect(c.border.length).toBeGreaterThan(0) } }) test('returns consistent references for same input', () => { const a = getCalloutColors('info') const b = getCalloutColors('info') expect(a).toEqual(b) }) })