test: isolate disabled battle load fixture

This commit is contained in:
2026-07-29 04:04:17 +09:00
parent dacb8f06a9
commit f02407def4

View File

@@ -297,6 +297,21 @@ try {
await waitForMapMenuVisibility(page, false);
await page.waitForTimeout(80);
await page.evaluate(() => {
const battleId =
window.__HEROS_DEBUG__?.battle()?.battleId;
if (!battleId) {
throw new Error(
'Cannot prepare the unavailable-load keyboard fixture.'
);
}
const baseKey = `heros-web:battle:${battleId}`;
window.localStorage.removeItem(`${baseKey}:slot-1`);
window.localStorage.removeItem(baseKey);
window.localStorage.removeItem(
'heros-web:first-battle-state'
);
});
await page.keyboard.press('KeyM');
await waitForMapMenuVisibility(page, true);
state = await readBattleState(page);
@@ -1036,7 +1051,6 @@ function assertMapMenuFocus(keyboard, expectedId) {
boundsInside(item.bounds, keyboard.bounds) &&
boundsInsideViewport(item.bounds)
) &&
keyboard.items.some(({ available }) => available === false) &&
keyboard.focusedItem?.available === true &&
matchingItem?.focused === true &&
keyboard.items.filter(({ focused }) => focused).length === 1 &&