@@ -3,7 +3,7 @@ import { randomUUID } from 'node:crypto'
33import { afterAll , beforeAll , describe , expect , it } from 'vitest'
44
55import { checkOrgReadAccess } from '../supabase/functions/_backend/private/validate_password_compliance.ts'
6- import { BASE_URL , getSupabaseClient , headers , TEST_EMAIL , USER_EMAIL , USER_ID , USER_ID_2 , USER_PASSWORD } from './test-utils.ts'
6+ import { BASE_URL , executeSQL , getSupabaseClient , headers , TEST_EMAIL , USER_EMAIL , USER_ID , USER_ID_2 , USER_PASSWORD , USER_PASSWORD_HASH } from './test-utils.ts'
77
88const ORG_ID = randomUUID ( )
99const globalId = randomUUID ( )
@@ -310,6 +310,19 @@ describe('[POST] /private/validate_password_compliance', () => {
310310 const nonMemberPassword = USER_PASSWORD
311311 const supabase = getSupabaseClient ( )
312312
313+ await executeSQL (
314+ `INSERT INTO auth.users (id, email, encrypted_password, email_confirmed_at, created_at, updated_at, raw_user_meta_data)
315+ VALUES ($1, $2, $3, NOW(), NOW(), NOW(), '{}'::jsonb)
316+ ON CONFLICT (id) DO NOTHING` ,
317+ [ USER_ID , USER_EMAIL , USER_PASSWORD_HASH ] ,
318+ )
319+ await executeSQL (
320+ `INSERT INTO public.users (id, email, created_at, updated_at)
321+ VALUES ($1, $2, NOW(), NOW())
322+ ON CONFLICT (id) DO NOTHING` ,
323+ [ USER_ID , USER_EMAIL ] ,
324+ )
325+
313326 await supabase . from ( 'stripe_info' ) . insert ( {
314327 customer_id : nonMemberCustomerId ,
315328 status : 'succeeded' ,
0 commit comments