mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 13:20:22 +00:00
test: stabilize gateway wizard e2e flow
This commit is contained in:
@@ -71,4 +71,23 @@ describe("WizardSession", () => {
|
||||
expect(done.done).toBe(true);
|
||||
expect(done.status).toBe("cancelled");
|
||||
});
|
||||
|
||||
test("does not lose terminal completion when the last answer finishes the runner immediately", async () => {
|
||||
const session = new WizardSession(async (prompter) => {
|
||||
await prompter.text({ message: "Token" });
|
||||
});
|
||||
|
||||
const first = await session.next();
|
||||
expect(first.step?.type).toBe("text");
|
||||
if (!first.step) {
|
||||
throw new Error("expected first step");
|
||||
}
|
||||
|
||||
await session.answer(first.step.id, "ok");
|
||||
await Promise.resolve();
|
||||
|
||||
const done = await session.next();
|
||||
expect(done.done).toBe(true);
|
||||
expect(done.status).toBe("done");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user