diff --git a/apps/amm/tests/remove-liquidity.mjs b/apps/amm/tests/remove-liquidity.mjs index 3c118ab..af04c21 100644 --- a/apps/amm/tests/remove-liquidity.mjs +++ b/apps/amm/tests/remove-liquidity.mjs @@ -231,20 +231,20 @@ test("amm liquidity: remove from the A/B pool", async (app) => { // The dropdown entry's synthetic click may not take; fall back to the page's // openRemoveDialog(), the exact handler the entry's onActivated invokes. + const dialogId = await idByObjectName(app, "removeLiquidityDialog"); try { await app.waitFor( - async () => { if (!(await maybeIdByObjectName(app, "removeLiquidityDialog"))) throw new Error("no dialog"); }, - { timeout: 4000, interval: 300, description: "remove dialog present" }, + async () => { if ((await prop(app, dialogId, "visible")) !== true) throw new Error("dialog not visible"); }, + { timeout: 4000, interval: 300, description: "remove dialog open" }, ); } catch { console.log(" remove-entry click didn't take — opening the dialog via evaluate"); await ignore(() => evaluate(app, detailId, "openRemoveDialog()")); + await app.waitFor( + async () => { if ((await prop(app, dialogId, "visible")) !== true) throw new Error("dialog not visible"); }, + { timeout: 8000, interval: 300, description: "remove dialog open (after evaluate)" }, + ); } - const dialogId = await idByObjectName(app, "removeLiquidityDialog"); - await app.waitFor( - async () => { if ((await prop(app, dialogId, "visible")) !== true) throw new Error("dialog not visible"); }, - { timeout: 8000, interval: 300, description: "remove dialog open" }, - ); // 5. The dialog opens at 50% by default. Click the 50% preset to make the choice // explicit (a no-op on the default) and confirm it registers. Then wait for the