import { describe, it, expect } from 'vitest'
import { COLOR_TOKEN_KEYS, SHAPE_TOKEN_KEYS } from './keys'
import { TOKEN_COLORS } from '../tokens'

describe('theme-engine key sets', () => {
  it('color keys equal ui-tokens TOKEN_COLORS (single source)', () => {
    expect(COLOR_TOKEN_KEYS).toEqual(TOKEN_COLORS)
    expect(COLOR_TOKEN_KEYS).toHaveLength(18)
  })

  it('shape keys are namespaced, 17 total, with NO collision against color keys', () => {
    expect(SHAPE_TOKEN_KEYS).toHaveLength(6 + 7 + 4) // radius + font-size + font-weight
    expect(SHAPE_TOKEN_KEYS).toContain('radius-sm')
    expect(SHAPE_TOKEN_KEYS).toContain('font-size-sm')   // proves 'sm' disambiguated by namespace
    expect(SHAPE_TOKEN_KEYS).toContain('font-weight-bold')
    const overlap = SHAPE_TOKEN_KEYS.filter((k) => (COLOR_TOKEN_KEYS as readonly string[]).includes(k))
    expect(overlap).toEqual([])
    expect(new Set(SHAPE_TOKEN_KEYS).size).toBe(SHAPE_TOKEN_KEYS.length) // internally unique
  })
})
