From c96ebe1b642690d9cccef3bba39f5d9014a01d9b Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Wed, 18 Feb 2026 11:47:11 +0100 Subject: [PATCH] feat(e2e): add WebAuthn test user to fixture seeding --- tests/e2e/setup_db.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/e2e/setup_db.py b/tests/e2e/setup_db.py index d4e273b..0cfe3d8 100644 --- a/tests/e2e/setup_db.py +++ b/tests/e2e/setup_db.py @@ -62,6 +62,18 @@ async def seed() -> None: result["cred_username"] = "creduser" result["cred_password"] = "credpassword123" + # 5. Create a user with password for WebAuthn registration tests + # (login with password first, then register a passkey) + webauthn_user = User(userid="test-user-03", username="webauthnuser", groups=["users"]) + await user_repo.create(webauthn_user) + webauthn_password_hash = password_service.hash("webauthnpass123") + await cred_repo.create_password( + PasswordCredential(user_id=webauthn_user.userid, password_hash=webauthn_password_hash) + ) + result["webauthn_username"] = "webauthnuser" + result["webauthn_password"] = "webauthnpass123" + result["webauthn_userid"] = "test-user-03" + # 4. Create an expired/used magic link for negative test expired_link = await magic_link_service.create(username="expired") await magic_link_service.mark_used(expired_link.token)