fix: resume campaign progress safely
This commit is contained in:
@@ -153,8 +153,8 @@ assert(
|
||||
'Defeat results must never expose the victory-story continuation route'
|
||||
);
|
||||
assert(
|
||||
/if \(outcome === 'victory'\) \{\s*this\.resultContinueButton = this\.addResultButton/.test(battleSceneSource),
|
||||
'The victory-story result CTA must only be created for victories'
|
||||
/if \(\s*outcome === 'victory' \|\|\s*this\.resultReportPersistenceStatus ===\s*'failed'\s*\) \{\s*this\.resultContinueButton = this\.addResultButton/.test(battleSceneSource),
|
||||
'The result CTA must be available for victories and for either outcome when report persistence needs an explicit retry'
|
||||
);
|
||||
assert(
|
||||
/if \(outcome === 'victory'\) \{[\s\S]*?pages: battleScenario\.victoryPages,[\s\S]*?return;\s*\}\s*this\.beginResultNavigation\(\(\) => startLazyScene\(this, 'CampScene', campSceneData\)\);/.test(battleSceneSource),
|
||||
@@ -178,8 +178,19 @@ assert(
|
||||
'Continue must restore a pending aftermath before routing camp or ending campaign steps'
|
||||
);
|
||||
assert(
|
||||
/if \(data\?\.completedAftermathBattleId\) \{\s*completeCampaignAftermath\(data\.completedAftermathBattleId\);\s*\}/.test(campSceneSource),
|
||||
'CampScene must complete the pending aftermath before loading its campaign snapshot'
|
||||
campSceneSource.includes(
|
||||
'completeCampaignStoryHandoffAftermath('
|
||||
) &&
|
||||
campSceneSource.includes(
|
||||
'completeCampaignAftermath('
|
||||
) &&
|
||||
campSceneSource.indexOf(
|
||||
'completeCampaignStoryHandoffAftermath('
|
||||
) <
|
||||
campSceneSource.indexOf(
|
||||
'this.campaign = getCampaignState()'
|
||||
),
|
||||
'CampScene must atomically consume an exact story aftermath handoff, preserve its legacy completion path, and do both before loading its campaign snapshot'
|
||||
);
|
||||
|
||||
if (failures.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user