| 633 | } |
| 634 | |
| 635 | function extractQuestionId(sentFrames: unknown[]): string | undefined { |
| 636 | for (const frame of sentFrames) { |
| 637 | const env = frame as { type: string; payload: { question_id?: string } }; |
| 638 | if (env.type === 'event.question.requested' && env.payload.question_id) { |
| 639 | return env.payload.question_id; |
| 640 | } |
| 641 | } |
| 642 | return undefined; |
| 643 | } |
| 644 | |
| 645 | it('broadcasts event.question.requested AND settles via resolve(question_id, answers)', async () => { |
| 646 | const { broker, bus, broadcast, conn } = makeQuestionBroker(); |