fix: isolate battle save modal input
This commit is contained in:
@@ -705,7 +705,17 @@ async function verifyBattlePointerFlow(page) {
|
||||
coveredBounds: coveredBounds
|
||||
? { x: coveredBounds.x, y: coveredBounds.y, width: coveredBounds.width, height: coveredBounds.height }
|
||||
: null,
|
||||
selectedUnitId: scene.selectedUnit?.id ?? null
|
||||
persistentActionBounds: persistentActionBounds
|
||||
? {
|
||||
x: persistentActionBounds.x,
|
||||
y: persistentActionBounds.y,
|
||||
width: persistentActionBounds.width,
|
||||
height: persistentActionBounds.height
|
||||
}
|
||||
: null,
|
||||
selectedUnitId: scene.selectedUnit?.id ?? null,
|
||||
activeFaction: scene.activeFaction,
|
||||
turnNumber: scene.turnNumber
|
||||
};
|
||||
|
||||
function pointInsideBounds(point, bounds) {
|
||||
@@ -716,8 +726,10 @@ async function verifyBattlePointerFlow(page) {
|
||||
}
|
||||
});
|
||||
assert(
|
||||
battleModalProbe.blocker && battleModalProbe.coveredBounds,
|
||||
`Expected a full-screen battle save blocker and an interactive control behind it: ${JSON.stringify(battleModalProbe)}`
|
||||
battleModalProbe.blocker &&
|
||||
battleModalProbe.coveredBounds &&
|
||||
battleModalProbe.persistentActionBounds,
|
||||
`Expected a full-screen battle save blocker, an interactive control, and the persistent turn-end action behind it: ${JSON.stringify(battleModalProbe)}`
|
||||
);
|
||||
await clickSceneBounds(page, 'BattleScene', battleModalProbe.coveredBounds);
|
||||
await page.waitForTimeout(120);
|
||||
@@ -735,6 +747,26 @@ async function verifyBattlePointerFlow(page) {
|
||||
}
|
||||
})}`
|
||||
);
|
||||
await clickSceneBounds(page, 'BattleScene', battleModalProbe.persistentActionBounds);
|
||||
await page.waitForTimeout(120);
|
||||
const battleAfterCoveredTurnEndClick = await page.evaluate(() => window.__HEROS_DEBUG__?.battle());
|
||||
assert(
|
||||
battleAfterCoveredTurnEndClick?.saveSlotPanelMode === 'save' &&
|
||||
battleAfterCoveredTurnEndClick?.selectedUnitId === battleModalProbe.selectedUnitId &&
|
||||
battleAfterCoveredTurnEndClick?.turnPromptVisible === false &&
|
||||
battleAfterCoveredTurnEndClick?.activeFaction === battleModalProbe.activeFaction &&
|
||||
battleAfterCoveredTurnEndClick?.turnNumber === battleModalProbe.turnNumber,
|
||||
`Battle save modal allowed the persistent turn-end action behind it: ${JSON.stringify({
|
||||
before: battleModalProbe,
|
||||
after: {
|
||||
saveSlotPanelMode: battleAfterCoveredTurnEndClick?.saveSlotPanelMode,
|
||||
selectedUnitId: battleAfterCoveredTurnEndClick?.selectedUnitId,
|
||||
turnPromptVisible: battleAfterCoveredTurnEndClick?.turnPromptVisible,
|
||||
activeFaction: battleAfterCoveredTurnEndClick?.activeFaction,
|
||||
turnNumber: battleAfterCoveredTurnEndClick?.turnNumber
|
||||
}
|
||||
})}`
|
||||
);
|
||||
await verifyEarlyTurnEndSafety(page);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user