agent-ecosystem/test/main/services/extensions/SkillRootsResolver.test.ts
iliya 4b4dccd13d feat: add skills management features and integrate skills API
- Introduced skills catalog management with functionalities to list, get details, preview, and apply skill changes.
- Implemented IPC handlers for skills-related actions, enhancing communication between renderer and main processes.
- Updated the UI to include a dedicated Skills panel within the extension store, improving user access to skills management.
- Added new constants and types for skills API integration, ensuring a structured approach to skills handling.
- Enhanced state management to support skills loading, error handling, and detail fetching.
2026-03-11 21:46:56 +02:00

25 lines
913 B
TypeScript

import { describe, expect, it } from 'vitest';
import { SkillRootsResolver } from '@main/services/extensions/skills/SkillRootsResolver';
describe('SkillRootsResolver', () => {
it('returns user roots when no project path is provided', () => {
const resolver = new SkillRootsResolver();
const roots = resolver.resolve();
expect(roots).toHaveLength(3);
expect(roots.every((root) => root.scope === 'user')).toBe(true);
expect(roots.map((root) => root.rootKind)).toEqual(['claude', 'cursor', 'agents']);
});
it('returns project and user roots when project path is provided', () => {
const resolver = new SkillRootsResolver();
const roots = resolver.resolve('/tmp/demo-project');
expect(roots).toHaveLength(6);
expect(roots.filter((root) => root.scope === 'project')).toHaveLength(3);
expect(roots.filter((root) => root.scope === 'user')).toHaveLength(3);
});
});