Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

Wait for wrap dialog exit in desktop journey

Slendywy466d1d9c7166
diff --git a/evals/specs/budget-wrap-consent.e2e.test.ts b/evals/specs/budget-wrap-consent.e2e.test.ts
index b648f0f9..271e9867 100644
--- a/evals/specs/budget-wrap-consent.e2e.test.ts
+++ b/evals/specs/budget-wrap-consent.e2e.test.ts
@@ -26,6 +26,10 @@ test("a quota handoff waits for a choice, honors decline, and offers again after
}, [offerID, operation]),
{ awaitPromise: true },
);
+ const dismissed = () => probe.eventually(
+ () => probe.eval(() => !document.querySelector('[data-testid="budget-wrap-consent"]')),
+ { within: 10_000, until: (value) => value === true, label: "wrap dialog exit animation finished" },
+ );
await step("the offer stays visible until answered", async () => {
expect(await offer("allowance-one")).toMatchObject({ ok: true, result: { choice: "pending" } });
@@ -38,6 +42,7 @@ test("a quota handoff waits for a choice, honors decline, and offers again after
await step("declining suppresses that allowance's offer", async () => {
await user.click({ role: "button", label: "Keep working" });
+ await dismissed();
await user.notSee({ testId: "budget-wrap-consent" });
expect(await offer("allowance-one")).toMatchObject({ ok: true, result: { choice: "decline" } });
await user.notSee({ testId: "budget-wrap-consent" });
@@ -47,6 +52,7 @@ test("a quota handoff waits for a choice, honors decline, and offers again after
expect(await offer("allowance-two")).toMatchObject({ ok: true, result: { choice: "pending" } });
await user.see({ testId: "budget-wrap-consent" });
await user.click({ role: "button", label: "Wrap up" });
+ await dismissed();
await user.notSee({ testId: "budget-wrap-consent" });
expect(await offer("allowance-two")).toMatchObject({ ok: true, result: { choice: "accept" } });
expect(await offer("allowance-two", "finish")).toMatchObject({ ok: true });