import { describe, it, expect } from 'vitest' import { transformSource } from '../../scripts/modernist-codemod.mjs' const t = (s: string): string => transformSource(s) describe('modernist codemod', () => { it('removes rounded-* sizes but keeps rounded-full', () => { expect(t('
')).toBe('
') expect(t('
')).toBe('
') expect(t('
')).toBe('
') }) it('removes variant-prefixed rounded classes whole', () => { expect(t('')).toBe('') }) it('swaps bg-white for bg-surface, keeping variants and opacity', () => { expect(t('
')).toBe('
') expect(t('
')).toBe('
') }) it('swaps light gray borders and dividers for the divider token', () => { expect(t('
')).toBe('
') expect(t('
    ')).toBe('
      ') }) it('leaves dark gray borders alone', () => { expect(t('
      ')).toBe('
      ') }) it('swaps heavy shadows for shadow-lg', () => { expect(t('
      ')).toBe('
      ') expect(t('
      ')).toBe('
      ') expect(t('
      ')).toBe('
      ') }) it('handles template literals with conditionals', () => { const src = '
      ' expect(t(src)).toBe('
      ') }) it('drops a className that becomes empty', () => { expect(t('
      ')).toBe('
      ') }) it('does not touch text outside className', () => { const src = '

      The corners are rounded and bg-white is a word.

      ' expect(t(src)).toBe(src) }) it('is idempotent', () => { const once = t('
      ') expect(t(once)).toBe(once) }) })