Files
KArtSell.Aegis/docs/Design/kbx-foundation-v52-fe-operational-navigation-screen-anatomy/tests/unit/kbx-runtime.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

27 lines
1.2 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import type { KbxConflictSnapshot, KbxOperationRun, KbxRuntimeNotice } from '@kbx/contracts'
describe('KBX runtime contract', () => {
it('distinguishes degraded mode from normal business state', () => {
const notice: KbxRuntimeNotice = { mode: 'degraded', title: '택배 연계 지연', retryAllowed: true }
expect(notice.mode).toBe('degraded')
})
it('keeps concurrency conflict explicit instead of silent overwrite', () => {
const conflict: KbxConflictSnapshot = {
code: 'ORDER_VERSION_CONFLICT', title: '다른 사용자가 변경했습니다.', requestedVersion: 3, currentVersion: 4,
changes: [{ field: 'quantity', label: '수량', mine: 10, latest: 8 }],
}
expect(conflict.currentVersion).toBeGreaterThan(conflict.requestedVersion!)
})
it('can represent partial completion without reporting full success', () => {
const run: KbxOperationRun = {
id: 'op-1', type: 'bulk-ship', title: '대량 출고지시', status: 'partially-completed', requestedAt: new Date().toISOString(),
total: 100, processed: 100, succeeded: 97, failed: 3,
}
expect(run.status).toBe('partially-completed')
expect(run.failed).toBe(3)
})
})