| 65 | await schemaTestDb.db.insert(schema.kilocode_users).values( |
| 66 | [userId, otherUserId].map(id => ({ |
| 67 | id, |
| 68 | google_user_email: `${id}@example.com`, |
| 69 | google_user_name: 'Sidebar schema test', |
| 70 | google_user_image_url: '', |
| 71 | stripe_customer_id: `cus_${crypto.randomUUID()}`, |
| 72 | })) |
| 73 | ); |
| 74 | await schemaTestDb.db.insert(schema.organizations).values([ |
| 75 | { id: organizationId, name: 'Sidebar schema organization' }, |
| 76 | { id: otherOrganizationId, name: 'Other sidebar schema organization' }, |
| 77 | ]); |
| 78 | }); |
| 79 | |
| 80 | afterEach(async () => { |
| 81 | await schemaTestDb.db |
| 82 | .delete(schema.cloud_agent_worktrees) |
| 83 | .where(inArray(schema.cloud_agent_worktrees.kilo_user_id, [userId, otherUserId])); |
| 84 | await schemaTestDb.db |
| 85 | .delete(schema.kilocode_users) |
| 86 | .where(inArray(schema.kilocode_users.id, [userId, otherUserId])); |
| 87 | await schemaTestDb.db |