Update test cases and improve account actioning

This commit refactors Supabase test cases to reflect the updated account actioning mechanism. The "makerkit.get_user_id" function calls were replaced with the new "tests.get_supabase_uid" function, aligning with the testing structure update. It also introduces new policies which further refine user role actions with more precise checks, replacing the old 'delete' policy with the more comprehensive 'can_action_account_member' function. New test cases for updating memberships and deleting memberships have also been added.
This commit is contained in:
giancarlo
2024-04-20 23:22:18 +08:00
parent a55655a61a
commit f7fe67f7f7
8 changed files with 192 additions and 94 deletions

View File

@@ -75,7 +75,7 @@ select throws_ok(
update public.accounts_memberships
set account_role = 'custom-role'
where account_id = makerkit.get_account_id_by_slug('test')
and user_id = makerkit.get_user_id('test1@test.com');
and user_id = tests.get_supabase_uid('test1');
set local role postgres;