397777089e
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
1.0 KiB
JavaScript
24 lines
1.0 KiB
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import { isPlanDeclaredSkill } from './enforce-supreme-gate.mjs';
|
|
|
|
describe('стена: навык из печати разрешён к вызову', () => {
|
|
const fp = { skills: ['claude-md-management', 'test-driven-development'] };
|
|
|
|
it('Skill из skills печати → true (по суффиксу)', () => {
|
|
expect(isPlanDeclaredSkill({ name: 'Skill', input: { skill: 'claude-md-management:revise-claude-md' } }, fp)).toBe(true);
|
|
});
|
|
|
|
it('Skill вне печати → false', () => {
|
|
expect(isPlanDeclaredSkill({ name: 'Skill', input: { skill: 'brainstorming' } }, fp)).toBe(false);
|
|
});
|
|
|
|
it('не Skill → false', () => {
|
|
expect(isPlanDeclaredSkill({ name: 'Bash', input: { command: 'x' } }, fp)).toBe(false);
|
|
});
|
|
|
|
it('нет печати / нет skills → false', () => {
|
|
expect(isPlanDeclaredSkill({ name: 'Skill', input: { skill: 'x' } }, null)).toBe(false);
|
|
expect(isPlanDeclaredSkill({ name: 'Skill', input: { skill: 'x' } }, {})).toBe(false);
|
|
});
|
|
});
|