Filter invalid campaign reward recruits
This commit is contained in:
@@ -650,6 +650,7 @@ try {
|
||||
recruits: [
|
||||
{ unitId: ' guan-yu ', name: ' Guan Yu ' },
|
||||
{ unitId: 'guan-yu', name: 'Duplicate Guan Yu' },
|
||||
{ unitId: 'ghost-recruit', name: 'Ghost Recruit' },
|
||||
{ unitId: '', name: 'Broken' },
|
||||
...Array.from({ length: 140 }, (_, index) => ({ unitId: `recruit-${index}`, name: `Recruit ${index}` }))
|
||||
],
|
||||
@@ -691,7 +692,7 @@ try {
|
||||
malformedReport.firstBattleReport.campaignRewards?.supplies[0] === 'Bean' &&
|
||||
malformedReport.firstBattleReport.campaignRewards?.equipment.length === 1 &&
|
||||
malformedReport.firstBattleReport.campaignRewards?.reputation.length === 1 &&
|
||||
malformedReport.firstBattleReport.campaignRewards?.recruits.length === 128 &&
|
||||
malformedReport.firstBattleReport.campaignRewards?.recruits.length === 1 &&
|
||||
malformedReport.firstBattleReport.campaignRewards?.recruits[0].unitId === 'guan-yu' &&
|
||||
malformedReport.firstBattleReport.campaignRewards?.recruits[0].name === 'Guan Yu' &&
|
||||
malformedReport.firstBattleReport.campaignRewards?.recruits.filter((recruit) => recruit.unitId === 'guan-yu').length === 1 &&
|
||||
@@ -757,7 +758,11 @@ try {
|
||||
supplies: { corrupted: true },
|
||||
equipment: ['Iron Sword'],
|
||||
reputation: 'Fame',
|
||||
recruits: [{ unitId: 'test-recruit', name: 'Test Recruit' }, { broken: true }],
|
||||
recruits: [
|
||||
{ unitId: 'test-recruit', name: 'Test Recruit' },
|
||||
{ unitId: ' guan-yu ', name: ' Guan Yu ' },
|
||||
{ broken: true }
|
||||
],
|
||||
unlocks: [
|
||||
{ battleId: 'ghost-battle', title: 'Ghost Battle' },
|
||||
{ battleId: 'second-battle-yellow-turban-pursuit', title: 'Next Pursuit' }
|
||||
@@ -883,6 +888,7 @@ try {
|
||||
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.itemRewards.length === 1 &&
|
||||
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.campaignRewards?.equipment[0] === 'Iron Sword' &&
|
||||
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.campaignRewards?.recruits.length === 1 &&
|
||||
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.campaignRewards?.recruits[0].unitId === 'guan-yu' &&
|
||||
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.campaignRewards?.unlocks.length === 1 &&
|
||||
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.campaignRewards?.unlocks[0].battleId === 'second-battle-yellow-turban-pursuit' &&
|
||||
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.campaignRewards?.note === undefined,
|
||||
|
||||
Reference in New Issue
Block a user