fix: leave restored city shops safely
This commit is contained in:
@@ -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 }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user