Normalize campaign reward labels

This commit is contained in:
2026-07-05 10:27:19 +09:00
parent 74dfe8f665
commit 243a97bcb8
2 changed files with 25 additions and 11 deletions

View File

@@ -343,11 +343,12 @@ try {
mvp: { unitId: 'liu-bei', name: 'Liu Bei', damageDealt: '88', defeats: '2' },
itemRewards: ['Bean', 'Bean', 10],
campaignRewards: {
supplies: ['Bean', 'Bean', 20],
equipment: ['Iron Sword'],
reputation: ['Village Thanks'],
recruits: [{ unitId: 'guan-yu', name: 'Guan Yu' }, { unitId: '', name: 'Broken' }],
unlocks: [{ battleId: 'second-battle-yellow-turban-pursuit', title: 'Next' }, { battleId: '', title: 'Broken' }]
supplies: [' Bean ', 'Bean', 20],
equipment: [' Iron Sword ', 'Iron Sword'],
reputation: ['Village Thanks', ' Village Thanks '],
recruits: [{ unitId: ' guan-yu ', name: ' Guan Yu ' }, { unitId: '', name: 'Broken' }],
unlocks: [{ battleId: ' second-battle-yellow-turban-pursuit ', title: ' Next ' }, { battleId: '', title: 'Broken' }],
note: ' Reward note '
},
completedCampDialogues: ['intro', 'intro', 7],
completedCampVisits: { corrupted: true },
@@ -373,7 +374,13 @@ try {
malformedReport.firstBattleReport.mvp?.damageDealt === 88 &&
malformedReport.firstBattleReport.itemRewards.length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.supplies.length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.supplies[0] === 'Bean' &&
malformedReport.firstBattleReport.campaignRewards?.equipment.length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.reputation.length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.recruits.length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.recruits[0].unitId === 'guan-yu' &&
malformedReport.firstBattleReport.campaignRewards?.unlocks[0].battleId === 'second-battle-yellow-turban-pursuit' &&
malformedReport.firstBattleReport.campaignRewards?.note === 'Reward note' &&
malformedReport.firstBattleReport.completedCampDialogues.length === 1 &&
malformedReport.firstBattleReport.completedCampVisits.length === 0,
`Expected malformed report fields to be normalized without discarding the report: ${JSON.stringify(malformedReport)}`