Files
KArtSell.Aegis/docs/Design/kbx-foundation-v52-fe-operational-navigation-screen-anatomy/tests/unit/kbx-api-contract.spec.ts
T
kjh2064 c41e5063b7 chore: remove kbx-foundation-v36 reference (superseded by v4 implementation)
Removed entire kbx-foundation-v36 directory as it's been replaced by
the new KBX Foundation v4 patterns implemented in this session:
- Registry-driven screen definitions
- Density-aware UI adapter components
- Feature module templates (ShadowRun, Models)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-12 01:39:58 +09:00

23 lines
963 B
TypeScript

import { describe, expect, it } from 'vitest'
import { isKbxProblem, kbxApiCatalog } from '@kbx/contracts'
describe('KBX API contract', () => {
it('keeps operation IDs and routes unique', () => {
const operations = Object.values(kbxApiCatalog)
expect(new Set(operations.map(x => x.id)).size).toBe(operations.length)
expect(new Set(operations.map(x => `${x.method} ${x.path}`)).size).toBe(operations.length)
})
it('requires a stable key only for mutation operations', () => {
const required = Object.values(kbxApiCatalog).filter(x => x.idempotency === 'required')
expect(required.length).toBeGreaterThan(0)
expect(required.every(x => x.method !== 'GET')).toBe(true)
})
it('recognizes the public problem discriminator family', () => {
for (const type of ['validation','business-rule','conflict','permission','not-found','integration','system']) {
expect(isKbxProblem({ type, title: 'test' })).toBe(true)
}
})
})