import { describe, expect, it } from 'vitest'
import { searchNavigationEntries } from '../../packages/kbx-ui/src/shell/navigationSearch'
import type { KbxNavigationResolvedEntry } from '@kbx/contracts'
const entries:KbxNavigationResolvedEntry[]=[
  {screenId:'OMS-ORD-001',title:'주문관리',module:'OMS',section:'주문',path:'/oms/orders',keywords:['출고대기','주문조회']},
  {screenId:'ERP-INV-001',title:'재고현황',module:'ERP',section:'재고',path:'/erp/inventory',keywords:['현재고','가용재고']},
]
describe('navigation search',()=>{
  it('finds by Korean business keyword',()=>expect(searchNavigationEntries(entries,'출고')[0]?.screenId).toBe('OMS-ORD-001'))
  it('finds by screen id',()=>expect(searchNavigationEntries(entries,'ERP-INV-001')[0]?.screenId).toBe('ERP-INV-001'))
  it('finds familiar menu title without command syntax',()=>expect(searchNavigationEntries(entries,'주문관리')[0]?.title).toBe('주문관리'))
})
