()
| 31 | const createdUserIds = new Set<string>(); |
| 32 | |
| 33 | async function createBotRequest() { |
| 34 | const user = await insertTestUser(); |
| 35 | createdUserIds.add(user.id); |
| 36 | |
| 37 | const [row] = await db |
| 38 | .insert(bot_requests) |
| 39 | .values({ |
| 40 | created_by: user.id, |
| 41 | platform: 'slack', |
| 42 | platform_thread_id: `slack:T123:C456:${randomUUID()}`, |
| 43 | platform_message_id: `message-${randomUUID()}`, |
| 44 | user_message: 'Please make a change', |
| 45 | status: 'pending', |
| 46 | }) |
| 47 | .returning({ id: bot_requests.id }); |
| 48 | |
| 49 | if (!row) { |
| 50 | throw new Error('Failed to create bot request fixture'); |
| 51 | } |
| 52 | |
| 53 | createdBotRequestIds.add(row.id); |
| 54 | return row.id; |
| 55 | } |
| 56 | |
| 57 | afterEach(async () => { |
| 58 | const cloudAgentSessionIds = Array.from(createdCloudAgentSessionIds); |
no test coverage detected