import { ExecutionContext, ApprovalPolicy, ApprovalTier, RiskLevel, ActionCategory, MCP_DELIMITER, } from '../constants'; describe('HITL Approval Constants', () => { describe('ExecutionContext', () => { it('should have INTERACTIVE and SCHEDULED values', () => { expect(ExecutionContext.INTERACTIVE).toBe('interactive'); expect(ExecutionContext.SCHEDULED).toBe('scheduled'); }); it('should only have 3 values (interactive, scheduled, handoff)', () => { const values = Object.values(ExecutionContext); expect(values).toHaveLength(3); expect(values).toEqual(['interactive', 'scheduled', 'handoff']); }); }); describe('ApprovalPolicy', () => { it('should have ALWAYS and NEVER values', () => { expect(ApprovalPolicy.ALWAYS).toBe('always'); expect(ApprovalPolicy.NEVER).toBe('never'); }); }); describe('ApprovalTier', () => { it('should define the 3-tier evaluation pipeline', () => { expect(ApprovalTier.AUTO_APPROVE).toBe('auto_approve'); expect(ApprovalTier.RULE_BASED).toBe('rule_based'); expect(ApprovalTier.KEYWORD_FALLBACK).toBe('keyword_fallback'); }); }); describe('RiskLevel', () => { it('should define 5 risk levels from NONE to CRITICAL', () => { expect(RiskLevel.NONE).toBe('none'); expect(RiskLevel.LOW).toBe('low'); expect(RiskLevel.MEDIUM).toBe('medium'); expect(RiskLevel.HIGH).toBe('high'); expect(RiskLevel.CRITICAL).toBe('critical'); }); it('should have exactly 5 values', () => { expect(Object.values(RiskLevel)).toHaveLength(5); }); }); describe('ActionCategory', () => { it('should define action categories', () => { expect(ActionCategory.READ).toBe('read'); expect(ActionCategory.WRITE).toBe('write'); expect(ActionCategory.DELETE).toBe('delete'); expect(ActionCategory.SEND).toBe('send'); expect(ActionCategory.EXECUTE).toBe('execute'); expect(ActionCategory.FINANCIAL).toBe('financial'); expect(ActionCategory.ACCOUNT).toBe('account'); }); }); describe('MCP_DELIMITER', () => { it('should match the host data-provider mcp_delimiter constant', () => { expect(MCP_DELIMITER).toBe('_mcp_'); }); it('should NOT be the old double-underscore format', () => { expect(MCP_DELIMITER).not.toBe('__mcp__'); }); }); });