Files
makelore/tests/unit/skill-display.test.ts
2026-07-29 17:22:35 +08:00

29 lines
1.2 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('youth-plain-language')).toEqual({
name: '青少年通俗表达',
description: '让所有伙伴用简体中文、短句和少术语的方式,向 10 至 16 岁青少年解释任务。',
});
expect(getSkillDisplayInfo('pm-project-plan')).toEqual({
name: '通用软件项目规划',
description: '把软件想法整理成目标、用户、范围、里程碑、任务和验收标准。',
});
expect(getSkillDisplayInfo('nianxxgame-skill')).toEqual({
name: '网页游戏开发',
description: '完成游戏策划、开发、试玩、体验打磨和发布验证。',
});
});
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');
});
});