agent-ecosystem/test/renderer/components/extensions/skills/skillDraftUtils.test.ts
iliya d53999ba45 feat: add Radix UI Alert Dialog component and enhance SkillImportService
- Integrated the @radix-ui/react-alert-dialog package for improved alert dialog functionality.
- Updated SkillImportService to include a new inspectSourceDir method for enhanced file inspection and warning generation during skill imports.
- Refactored existing methods to streamline file reading and directory walking processes, improving overall performance and error handling.
- Added new SkillPlanService to manage skill upsert plans, enhancing the skills mutation workflow.
- Updated UI components to support new features and improve user experience in the skills management interface.
2026-03-12 11:53:40 +02:00

34 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import {
buildSkillTemplate,
readSkillTemplateInput,
} from '../../../../../src/renderer/components/extensions/skills/skillDraftUtils';
describe('skillDraftUtils', () => {
it('builds and parses structured sections for guided editing', () => {
const template = buildSkillTemplate({
name: 'Review Helper',
description: 'Helps with code review',
license: 'MIT',
compatibility: 'claude-code',
invocationMode: 'manual-only',
whenToUse: 'Use this when a PR needs review.',
steps: '1. Read the diff.\n2. Call out the biggest risk first.',
notes: '- Prefer concrete findings over summaries.',
});
const parsed = readSkillTemplateInput(template);
expect(parsed).toMatchObject({
name: 'Review Helper',
description: 'Helps with code review',
license: 'MIT',
compatibility: 'claude-code',
invocationMode: 'manual-only',
whenToUse: 'Use this when a PR needs review.',
steps: '1. Read the diff.\n2. Call out the biggest risk first.',
notes: '- Prefer concrete findings over summaries.',
});
});
});