Verify mid camp sortie integrity
This commit is contained in:
@@ -183,6 +183,27 @@ try {
|
||||
assert(midCampState?.campaign?.step === 'fifty-eighth-camp', `Expected mid-campaign save to continue into camp: ${JSON.stringify(midCampState)}`);
|
||||
assert(midCampState.campBattleId === 'fifty-eighth-battle-qishan-retreat', `Expected mid-campaign battle id: ${JSON.stringify(midCampState)}`);
|
||||
assert(midCampState.sortiePlan?.selectedCount > 0, `Expected mid-campaign formation state: ${JSON.stringify(midCampState?.sortiePlan)}`);
|
||||
assert(midCampState.sortieHasBattle === true, `Expected mid-campaign camp to keep a playable sortie target: ${JSON.stringify(midCampState)}`);
|
||||
assert(
|
||||
typeof midCampState.nextSortieBattleId === 'string' && midCampState.nextSortieBattleId.length > 0,
|
||||
`Expected mid-campaign sortie flow to expose a battle id: ${JSON.stringify(midCampState)}`
|
||||
);
|
||||
assert(
|
||||
midCampState.sortiePlan?.selectedCount <= midCampState.sortiePlan?.maxCount,
|
||||
`Expected mid-campaign sortie selection to stay within limit: ${JSON.stringify(midCampState?.sortiePlan)}`
|
||||
);
|
||||
assert(
|
||||
midCampState.sortiePlan?.selectedCount === midCampState.sortieDeploymentPreview?.length,
|
||||
`Expected mid-campaign deployment preview to match selected sortie count: ${JSON.stringify(midCampState?.sortiePlan)} / ${JSON.stringify(midCampState?.sortieDeploymentPreview)}`
|
||||
);
|
||||
assertUnique(
|
||||
midCampState.sortieDeploymentPreview?.map((slot) => slot.unitId),
|
||||
`Expected mid-campaign deployment preview to avoid duplicate units: ${JSON.stringify(midCampState?.sortieDeploymentPreview)}`
|
||||
);
|
||||
assertUnique(
|
||||
midCampState.sortieDeploymentPreview?.map((slot) => `${slot.x},${slot.y}`),
|
||||
`Expected mid-campaign deployment preview to avoid duplicate tiles: ${JSON.stringify(midCampState?.sortieDeploymentPreview)}`
|
||||
);
|
||||
|
||||
await seedCampaignSave(page, {
|
||||
battleId: 'sixty-sixth-battle-wuzhang-final',
|
||||
|
||||
Reference in New Issue
Block a user