import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import Badge from '@/components/ui/Badge.vue'

describe('Badge', () => {
  it('rendersCriticalVariant', () => {
    const wrapper = mount(Badge, {
      props: { variant: 'critical' },
      slots: { default: 'High' },
    })
    const classes = wrapper.classes().join(' ')
    expect(classes).toContain('bg-severity-critical/10')
    expect(classes).toContain('text-severity-critical')
  })

  it('rendersWarningVariant', () => {
    const wrapper = mount(Badge, {
      props: { variant: 'warning' },
      slots: { default: 'Med' },
    })
    const classes = wrapper.classes().join(' ')
    expect(classes).toContain('bg-severity-warning/10')
    expect(classes).toContain('text-severity-warning')
  })

  it('rendersSlotContent', () => {
    const wrapper = mount(Badge, {
      slots: { default: 'NEWS2 8' },
    })
    expect(wrapper.text()).toBe('NEWS2 8')
  })
})
