優化 Step2:改用 skill RPG 攻防腳色系統(新增 Mage 邏輯角色、Step3/4 套 Paladin 裁決人設) #15

Merged
jiantw83 merged 14 commits from develop into master 2026-06-16 09:05:55 +00:00
Showing only changes of commit fa95a463f8 - Show all commits
+11
View File
@@ -72,6 +72,11 @@ describe('buildAnalysisPrompt', () => {
assert.match(prompt, /審查重點:邊界與空值/);
assert.match(prompt, /只回傳 JSON 陣列/);
});
it('falls back to a default when focus is missing instead of showing undefined', () => {
const prompt = buildAnalysisPrompt({ name: 'NoFocus', body: 'x' });
assert.doesNotMatch(prompt, /undefined/);
});
});
describe('getRoleIntro', () => {
@@ -80,4 +85,10 @@ describe('getRoleIntro', () => {
assert.match(intro, /🔮 Tester/);
assert.match(intro, /logic/);
});
it('renders empty cells instead of undefined when focus/personality are missing', () => {
const intro = getRoleIntro([{ name: 'Bare' }]);
assert.match(intro, /Bare/);
assert.doesNotMatch(intro, /undefined/);
});
});