@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 5bfb66d
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 01:45 UTC

test: preserve immutable audit records in local tenant E2E

davoodmehraban89 committed Nov 17, 2026 at 09:46 UTC 5bfb66d776f5188e4d207e22ed72e390f55f901b
1 file changed +3 -4
scripts/wp2-auth-tenant-e2e.mjs
+3 -4
@@ -92,8 +92,7 @@ try {
92 assert.ok(mB.every(x => x.organization_id === orgB), 'tenant B can read foreign membership');
93 console.log('WP2_AUTH_TENANT_E2E_PASS: two Auth-issued JWTs; organization and membership RLS isolation verified through PostgREST.');
94 } finally {
95 - if (users.length) {
96 - const ids = users.map(x => `'${x}'`).join(',');
97 - sql(`delete from public.organization_audit where organization_id in (select id from public.organizations where owner_user_id in (${ids})); delete from public.organizations where owner_user_id in (${ids}); delete from auth.users where id in (${ids});`);
98 - }
95 + // Supabase Local is disposable; preserve immutable audit evidence.
96 + // The workflow tears down this entire database after the test.
97 + console.log(`WP2 fixture lifecycle: ${users.length} Auth users provisioned in disposable database.`);
98 }