diff --git a/scripts/verify-battle-keyboard-command-flow-browser.mjs b/scripts/verify-battle-keyboard-command-flow-browser.mjs index a768374..b5dab3b 100644 --- a/scripts/verify-battle-keyboard-command-flow-browser.mjs +++ b/scripts/verify-battle-keyboard-command-flow-browser.mjs @@ -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 &&