import { describe, expect, it } from 'vitest'
import { kbxComponentCatalog, kbxComponentManifest } from '@kbx/ui'

const requiredCore=[
  'KbxButton','KbxInput','KbxNumberField','KbxMoneyField','KbxQuantityField','KbxDateField','KbxDateRange','KbxSelect','KbxLookup','KbxCheckbox','KbxRadio','KbxTextarea','KbxTabs','KbxBadge','KbxTooltip','KbxBarcodeField',
  'KbxPageHeader','KbxCommandBar','KbxSearchPanel','KbxFormSection','KbxSectionHeader','KbxDataGrid','KbxBulkActionBar','KbxQuickFilterBar','KbxSummaryBar','KbxStatus',
  'KbxDialog','KbxDrawer','KbxToast','KbxConfirm','KbxExcelMenu','KbxExcelImport','KbxJobProgress','KbxAuditTrail','KbxHelpPanel','KbxAiPanel','KbxProposalPanel',
  'KbxListPage','KbxMasterPage','KbxTransactionPage','KbxMasterDetailPage','KbxQueuePage','KbxReconcilePage','KbxWmsMobilePage',
]

describe('KBX source-standard core component contract',()=>{
  it('publishes every v1 core component',()=>{
    const names=new Set(kbxComponentManifest.map(x=>x.name))
    for(const name of requiredCore) expect(names.has(name),name).toBe(true)
  })
  it('catalogs the highest-risk interactive components',()=>{
    const catalogued=new Set(kbxComponentCatalog.map(x=>x.component))
    for(const name of ['KbxInput','KbxLookup','KbxDataGrid','KbxCommandBar','KbxExcelImport','KbxWmsMobilePage','KbxApplicationShell']) expect(catalogued.has(name),name).toBe(true)
  })
})
