fix(tests): correct sessionId destructure and waitFor in thinking-block tests

The two FN-3300 streaming-path tests destructured `{ sessionId }` from
createSessionWithAgent (which returns a string), causing
SessionNotFoundError. Also added the missing vi.waitFor(currentQuestion)
that the streaming setup requires before submitResponse.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-03 11:21:49 -07:00
parent ec80d98d2a
commit 6a95b1507e

View File

@@ -3013,14 +3013,18 @@ describe("FN-3300: thinking-block response extraction", () => {
thinkingOutputPerPrompt: [questionJson, questionJson],
});
const { sessionId } = await createSessionWithAgent(
const sessionId = await createSessionWithAgent(
getUniqueIp(),
"Test plan",
TEST_ROOT_DIR,
);
await vi.waitFor(() => {
expect(getSession(sessionId)?.currentQuestion?.id).toBe("q-scope");
});
// Submit response to trigger continueAgentConversation
const result = await submitResponse(sessionId, { scope: "medium" });
const result = await submitResponse(sessionId, { "q-scope": "medium" }, TEST_ROOT_DIR);
expect(result.type).toBe("question");
if (result.type === "question") {
expect(result.data.id).toBe("q-scope");
@@ -3050,13 +3054,17 @@ describe("FN-3300: thinking-block response extraction", () => {
thinkingOutputPerPrompt: ["old-thinking-output"],
});
const { sessionId } = await createSessionWithAgent(
const sessionId = await createSessionWithAgent(
getUniqueIp(),
"Test plan",
TEST_ROOT_DIR,
);
const result = await submitResponse(sessionId, { scope: "medium" });
await vi.waitFor(() => {
expect(getSession(sessionId)?.currentQuestion?.id).toBe("q-from-text-block");
});
const result = await submitResponse(sessionId, { "q-from-text-block": "value" }, TEST_ROOT_DIR);
expect(result.type).toBe("question");
if (result.type === "question") {
expect(result.data.id).toBe("q-from-text-block");