50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
/**
|
|
* Tests del sistema de diseño InQ ROI — Sprint 1.5.
|
|
*
|
|
* Verifican que los tokens de marca estén correctamente definidos en
|
|
* tailwind.config.js y que no haya contaminación de la marca hermana CONCILIA.
|
|
*
|
|
* Estos tests son la fuente de verdad del contrato de marca: si cambiás
|
|
* un token, el test falla y te fuerza a ser explícito con el cambio.
|
|
*/
|
|
import { describe, it, expect } from 'vitest'
|
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
const tailwindConfig = require('../../tailwind.config.js').default ?? require('../../tailwind.config.js')
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
const colors = (tailwindConfig.theme.extend.colors) as Record<string, any>
|
|
|
|
describe('Design tokens — paleta InQ ROI', () => {
|
|
it('expone tokens de marca InQ con estructura anidada correcta', () => {
|
|
const inq = colors.inq
|
|
|
|
expect(inq.orange.DEFAULT).toBe('#F59845')
|
|
expect(inq.orange.dark).toBe('#B45309')
|
|
expect(inq.orange.light).toBe('#FEF3E2')
|
|
expect(inq.orange.lighter).toBe('#FFF8ED')
|
|
expect(inq.magenta).toBe('#ED3E8F')
|
|
})
|
|
|
|
it('NO incluye los colores de CONCILIA (marca hermana, no mezclar)', () => {
|
|
const configStr = JSON.stringify(tailwindConfig)
|
|
|
|
// Morado primario de CONCILIA
|
|
expect(configStr).not.toContain('#572FA2')
|
|
expect(configStr).not.toContain('#572fa2')
|
|
|
|
// Magenta de CONCILIA
|
|
expect(configStr).not.toContain('#CB1889')
|
|
expect(configStr).not.toContain('#cb1889')
|
|
})
|
|
|
|
it('expone tokens del heatmap saturado (calibrado para tests E2E)', () => {
|
|
const heatmap = colors.heatmap
|
|
|
|
// Valores en mayúscula: #10B981, #F59E0B, #EF4444
|
|
// Deben coincidir con HEATMAP_LOW/MID/HIGH en src/lib/colors.ts
|
|
expect(heatmap.low).toBe('#10B981')
|
|
expect(heatmap.mid).toBe('#F59E0B')
|
|
expect(heatmap.high).toBe('#EF4444')
|
|
})
|
|
})
|