import type { TransformedToken } from 'style-dictionary/types'

import { describe, expect, it } from 'vitest'

import { transformTailwindColorRgb } from './tailwind-color.mjs'

describe('transform/tailwind-color', () => {
  it('should leave value unchanged if not in tailwind RGB format', () => {
    const token = {
      $value: '#FF00003C',
    } as TransformedToken
    const result = transformTailwindColorRgb(token, {}, {})
    expect(result).toEqual('rgba(255, 0, 0, 0.24)')
  })

  it('should return the space-separated RGB values', () => {
    const token = {
      value: '#00FF00',
    } as TransformedToken
    const result = transformTailwindColorRgb(token, {}, {})
    expect(result).toEqual('0 255 0')
  })
})
