mirror of
http://88.130.71.182:3000/BlitTech/badoHair_be.git
synced 2026-06-12 23:23:22 +00:00
Fix 2 broken test assertions, add 22 new tests for register flow, booking email resilience, settings, and customers
This commit is contained in:
@@ -43,8 +43,11 @@ async def test_register_with_name_field(anon_client, mock_db):
|
||||
"""Frontend sends `name`, not `full_name` — both must be accepted."""
|
||||
mock_db.execute = AsyncMock(return_value="INSERT 1")
|
||||
|
||||
with patch("app.services.auth_service._client") as mock_client:
|
||||
mock_client.return_value.auth.sign_up.return_value = _supabase_session()
|
||||
with patch("app.services.auth_service._admin_client") as mock_admin, \
|
||||
patch("app.services.auth_service._client") as mock_client:
|
||||
user = MagicMock(); user.id = "11111111-1111-1111-1111-111111111111"
|
||||
mock_admin.return_value.auth.admin.create_user.return_value = MagicMock(user=user)
|
||||
mock_client.return_value.auth.sign_in_with_password.return_value = _supabase_session()
|
||||
r = await anon_client.post("/api/v1/auth/register", json={
|
||||
"email": "new@test.com",
|
||||
"password": "password123",
|
||||
@@ -59,8 +62,11 @@ async def test_register_with_full_name_field(anon_client, mock_db):
|
||||
"""full_name field also accepted."""
|
||||
mock_db.execute = AsyncMock(return_value="INSERT 1")
|
||||
|
||||
with patch("app.services.auth_service._client") as mock_client:
|
||||
mock_client.return_value.auth.sign_up.return_value = _supabase_session()
|
||||
with patch("app.services.auth_service._admin_client") as mock_admin, \
|
||||
patch("app.services.auth_service._client") as mock_client:
|
||||
user = MagicMock(); user.id = "11111111-1111-1111-1111-111111111111"
|
||||
mock_admin.return_value.auth.admin.create_user.return_value = MagicMock(user=user)
|
||||
mock_client.return_value.auth.sign_in_with_password.return_value = _supabase_session()
|
||||
r = await anon_client.post("/api/v1/auth/register", json={
|
||||
"email": "new2@test.com",
|
||||
"password": "password123",
|
||||
|
||||
Reference in New Issue
Block a user