fix: leave restored city shops safely

This commit is contained in:
2026-07-28 18:20:05 +09:00
parent cf93ba7234
commit a9e6e952c8
2 changed files with 46 additions and 10 deletions

View File

@@ -168,7 +168,13 @@ async function verifyRenderer(browserInstance, baseUrl, rendererFixture) {
);
await reloadAndContinueCity(page);
await openMarketWithRealInteraction(page);
await page.waitForFunction(() => {
const state = window.__HEROS_DEBUG__?.cityStay?.();
return (
state?.shop?.open === true &&
state?.explorationCheckpoint?.overlay?.type === 'shop'
);
});
city = await readCity(page);
assertMarketReceipt(city, `${rendererFixture.renderer} reload`);
const restoredOffer = findOffer(city, offerId);
@@ -217,12 +223,28 @@ async function verifyRenderer(browserInstance, baseUrl, rendererFixture) {
const diagnostic = await page.evaluate(() => ({
activeScenes:
window.__HEROS_DEBUG__?.activeScenes?.() ?? [],
scenes:
window.__HEROS_GAME__?.scene
.getScenes(false)
.map((scene) => ({
key: scene.scene.key,
active:
window.__HEROS_GAME__?.scene.isActive(
scene.scene.key
) ?? false,
status: scene.sys.settings.status
})) ?? [],
city: window.__HEROS_DEBUG__?.cityStay?.(),
camp: window.__HEROS_DEBUG__?.camp?.()
}));
throw new Error(
`${error.message}\nEquipment routing diagnostic: ${JSON.stringify(
diagnostic
{
...diagnostic,
ctaClickProbe,
pageErrors,
consoleErrors
}
)}`,
{ cause: error }
);