Nychthemeron/packages/library/tests/tailwind-tokens.spec.ts
2026-07-15 19:28:29 -04:00

28 lines
990 B
TypeScript

import { describe, it, expect } from 'vitest'
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
const cssPath = resolve(process.cwd(), 'src/assets/css/tailwind.css')
describe('tailwind token mapping', () => {
const css = readFileSync(cssPath, 'utf-8')
it('maps --color-primary onto the existing --primary token', () => {
expect(css).toMatch(/--color-primary:\s*var\(--primary\)/)
})
it('maps --color-destructive onto the existing --danger token', () => {
expect(css).toMatch(/--color-destructive:\s*var\(--danger\)/)
})
it('defines the extra info/success/warning color slots', () => {
expect(css).toMatch(/--color-info:\s*var\(--info\)/)
expect(css).toMatch(/--color-success:\s*var\(--success\)/)
expect(css).toMatch(/--color-warning:\s*var\(--warn\)/)
})
it('keeps both Hades and Apollo theme selectors', () => {
expect(css).toContain("[data-theme='hades']")
expect(css).toContain("[data-theme='apollo']")
})
})