import { describe, it, expect } from 'vitest'
import {
  USE_CASE_LABELS, MC_VERIFICATION_LABELS, useCaseLabel, mcVerificationLabel,
} from '../components/mcMappingLabels'

describe('useCaseLabel', () => {
  it('maps known use-case keys to German labels', () => {
    expect(useCaseLabel('impressum')).toBe('Impressum')
    expect(useCaseLabel('cookie_banner')).toBe('Cookie-Banner')
    expect(useCaseLabel('code_security')).toBe('Code Security')
    expect(useCaseLabel('dse')).toBe('Datenschutzerklärung')
  })

  it('humanizes an unknown key instead of showing the raw slug', () => {
    expect(useCaseLabel('brand_new_thing')).toBe('Brand New Thing')
  })
})

describe('mcVerificationLabel', () => {
  it('maps the master-control verification methods', () => {
    expect(mcVerificationLabel('source_code')).toBe('Source Code')
    expect(mcVerificationLabel('it_process')).toBe('IT-Prozess')
    expect(mcVerificationLabel('network')).toBe('Netzwerk/Infra')
    expect(mcVerificationLabel('document')).toBe('Dokument')
  })

  it('humanizes an unknown method', () => {
    expect(mcVerificationLabel('telepathy')).toBe('Telepathy')
  })
})

describe('label coverage', () => {
  it('labels the security/code use cases (>=50% code+process focus)', () => {
    for (const k of ['code_security', 'network_security', 'cra', 'isms', 'tisax']) {
      expect(USE_CASE_LABELS[k]).toBeTruthy()
    }
  })

  it('covers every master-control verification method', () => {
    for (const m of ['document', 'source_code', 'network', 'it_process', 'hybrid', 'manual']) {
      expect(MC_VERIFICATION_LABELS[m]).toBeTruthy()
    }
  })
})
