Add waitFor to ensure shell session close callback in edge-broker test

This commit is contained in:
Jeppe Bundgaard
2026-04-14 16:38:37 +02:00
parent a1bde3f51e
commit 5c51601c62
@@ -208,6 +208,7 @@ test("broker closes browser shell sessions when the agent disconnects before she
agent.terminate();
await waitForClose(browser);
await waitFor(() => closedSessions.length === 1, { description: "disconnect shell session close callback" });
assert.ok(agentMessages.some((message) => message.type === "OPEN_ROOT_SHELL" && message.payload.sessionId === "shell-4"));
assert.deepEqual(closedSessions, [{ transcript: "", reason: "agent_disconnected" }]);