First of all: Great package, thanks you so much!! I have built many, many tests with these helpers 馃槂
When testing anonymous users in supabase the RLS policies rely on the is_anonymous field in the jwt:
select (auth.jwt()->>'is_anonymous')::boolean
Please, refer to the supabase docs for more information on anonymous users: https://supabase.com/docs/guides/auth/auth-anonymous?queryGroups=language&language=js#access-control
In the end the problem is in the "authenticate_as" function, because there are some fields mapped to the jwt claims, but the is_anonymous field is missing. Adding it should solve this issue and the supabase-test-helpers should be sufficient for supabase RLS testing.
First of all: Great package, thanks you so much!! I have built many, many tests with these helpers 馃槂
When testing anonymous users in supabase the RLS policies rely on the is_anonymous field in the jwt:
select (auth.jwt()->>'is_anonymous')::booleanPlease, refer to the supabase docs for more information on anonymous users: https://supabase.com/docs/guides/auth/auth-anonymous?queryGroups=language&language=js#access-control
In the end the problem is in the "authenticate_as" function, because there are some fields mapped to the jwt claims, but the is_anonymous field is missing. Adding it should solve this issue and the supabase-test-helpers should be sufficient for supabase RLS testing.