| 39 | google_user_image_url: '', |
| 40 | stripe_customer_id: `cus_${crypto.randomUUID()}`, |
| 41 | }) |
| 42 | .returning(); |
| 43 | expect(user.api_token_pepper).toMatch( |
| 44 | /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ |
| 45 | ); |
| 46 | } finally { |
| 47 | await schemaTestDb.db |
| 48 | .delete(schema.kilocode_users) |
| 49 | .where(eq(schema.kilocode_users.id, pepperUserId)); |
| 50 | } |
| 51 | }); |
| 52 | }); |
| 53 | |
| 54 | describe('cloud agent stacked workspace schema', () => { |
| 55 | let userId: string; |
| 56 | let otherUserId: string; |
| 57 | let organizationId: string; |
| 58 | let otherOrganizationId: string; |
| 59 | |
| 60 | beforeEach(async () => { |
| 61 | userId = `oauth/schema-sidebar-${crypto.randomUUID()}`; |
| 62 | otherUserId = `oauth/schema-sidebar-${crypto.randomUUID()}`; |
| 63 | organizationId = crypto.randomUUID(); |
| 64 | otherOrganizationId = crypto.randomUUID(); |
| 65 | await schemaTestDb.db.insert(schema.kilocode_users).values( |
| 66 | [userId, otherUserId].map(id => ({ |
| 67 | id, |
| 68 | google_user_email: `${id}@example.com`, |