33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { getSkillDisplayInfo } from '@/lib/skill-display';
|
|
|
|
describe('skill display metadata', () => {
|
|
it('keeps runtime ids internal and returns Chinese-only learner-facing copy', () => {
|
|
expect(getSkillDisplayInfo('agent-browser')).toEqual({
|
|
name: '开发浏览器',
|
|
description: '打开、查看或调试本地及公网网页,读取 Console、Network、DOM 和样式信息。',
|
|
});
|
|
expect(getSkillDisplayInfo('frontend-slides')).toEqual({
|
|
name: '项目演示',
|
|
description: '把项目内容整理成可播放的 16:9 HTML 幻灯片,不生成 PPTX 或云端发布。',
|
|
});
|
|
expect(getSkillDisplayInfo('grilling')).toEqual({
|
|
name: '方案质询',
|
|
description: '在重要工作开始前逐项澄清目标、范围和关键取舍,确认后再执行。',
|
|
});
|
|
expect(getSkillDisplayInfo('planning-with-files')).toEqual({
|
|
name: '项目规划',
|
|
description: '为复杂任务维护可恢复的计划、发现和进展,记录在项目的 .niancode/agent-planning/ 中。',
|
|
});
|
|
});
|
|
|
|
it('does not expose an unknown external runtime id', () => {
|
|
const display = getSkillDisplayInfo('repo-audit');
|
|
expect(display).toEqual({
|
|
name: '自定义技能',
|
|
description: '用于扩展伙伴能力的自定义工具。',
|
|
});
|
|
expect(`${display.name}${display.description}`).not.toContain('repo-audit');
|
|
});
|
|
});
|