Recover blank campaign battle titles

This commit is contained in:
2026-07-05 12:07:56 +09:00
parent d48726c21c
commit 3e7a7c2478
2 changed files with 9 additions and 10 deletions

View File

@@ -446,6 +446,7 @@ try {
gold: 320,
firstBattleReport: {
battleId: 'first-battle-zhuo-commandery',
battleTitle: ' ',
outcome: 'victory',
turnNumber: '4',
rewardGold: '120',
@@ -542,7 +543,7 @@ try {
);
assert(
malformedReport.firstBattleReport?.battleId === 'first-battle-zhuo-commandery' &&
malformedReport.firstBattleReport.battleTitle.length > 0 &&
malformedReport.firstBattleReport.battleTitle === firstScenario.title &&
malformedReport.firstBattleReport.turnNumber === 4 &&
malformedReport.firstBattleReport.objectives.length === 24 &&
malformedReport.firstBattleReport.objectives[0].rewardGold === 80 &&
@@ -609,7 +610,7 @@ try {
battleHistory: {
'wrong-history-key': {
battleId: 'first-battle-zhuo-commandery',
battleTitle: 'Zhuo Commandery',
battleTitle: ' ',
outcome: 'victory',
rewardGold: '120',
itemRewards: ['Bean', 12, 'Bean'],
@@ -724,6 +725,7 @@ try {
assert(
Object.keys(malformedHistory.battleHistory).length === 1 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.rewardGold === 120 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.battleTitle === firstScenario.title &&
malformedHistory.battleHistory['wrong-history-key'] === undefined,
`Expected malformed battle history entries to be filtered while valid settlements are keyed by battleId: ${JSON.stringify(malformedHistory)}`
);