Files
KArtSell.Aegis/docs/Design/kbx-foundation-v60-status-canonical-contract-hardening/tests/unit/kbx-field-contract.spec.ts
T
kjh2064 3f293d8aa8
deploy / deploy (push) Successful in 1m52s
deploy / notify (push) Successful in 1s
V13-FE-006: consolidate approved UI and contract hardening
2026-08-13 02:41:00 +09:00

22 lines
887 B
TypeScript

import { describe, expect, it } from 'vitest'
import { getKbxField, kbxImportField, kbxFieldCatalog } from '@kbx/contracts'
describe('KBX canonical field dictionary', () => {
it('keeps sensitive fields maskable', () => {
const sensitive = Object.values(kbxFieldCatalog).filter(field => field.sensitive)
expect(sensitive.length).toBeGreaterThan(0)
expect(sensitive.every(field => 'masking' in field && Boolean(field.masking))).toBe(true)
})
it('uses orderQty as the OMS order quantity field', () => {
expect(getKbxField('orderQty').dataType).toBe('quantity')
expect(kbxImportField('orderQty').required).toBe(true)
})
it('does not make server/domain rules part of metadata', () => {
const field = getKbxField('orderQty') as Record<string, unknown>
expect(field.allowedStatuses).toBeUndefined()
expect(field.stockPolicy).toBeUndefined()
})
})