37 lines
1.7 KiB
TypeScript
37 lines
1.7 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('game-engine')).toEqual({
|
|
name: '游戏引擎',
|
|
description: '构建基于 HTML5、Canvas、WebGL 和 JavaScript 的 2D/3D 游戏,处理循环、物理、碰撞、输入、音频与本地预览。',
|
|
});
|
|
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');
|
|
});
|
|
});
|