c41e5063b7
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>
19 lines
778 B
TypeScript
19 lines
778 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { kbxAiCapabilities, getSensitivePolicyForField } from '../../apps/web/src/permissions/authorizationPolicy'
|
|
|
|
describe('KBX authorization contracts', () => {
|
|
it('does not grant AI execute from AI-use permission alone', () => {
|
|
expect(kbxAiCapabilities(['common.ai.use'], ['explain', 'suggest', 'draft', 'execute']))
|
|
.toEqual(['explain', 'suggest', 'draft'])
|
|
})
|
|
|
|
it('requires explicit AI execute permission', () => {
|
|
expect(kbxAiCapabilities(['common.ai.use', 'common.ai.execute'], ['explain', 'execute']))
|
|
.toEqual(['explain', 'execute'])
|
|
})
|
|
|
|
it('maps phone to the order recipient sensitive policy', () => {
|
|
expect(getSensitivePolicyForField('phone')?.id).toBe('oms.order.recipient')
|
|
})
|
|
})
|