feat(e2e): add WebAuthn test user to fixture seeding

This commit is contained in:
Johan Lundberg 2026-02-18 11:47:11 +01:00
parent ef8bf10555
commit c96ebe1b64
No known key found for this signature in database
GPG key ID: A6C152738D03C7D1

View file

@ -62,6 +62,18 @@ async def seed() -> None:
result["cred_username"] = "creduser" result["cred_username"] = "creduser"
result["cred_password"] = "credpassword123" 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 # 4. Create an expired/used magic link for negative test
expired_link = await magic_link_service.create(username="expired") expired_link = await magic_link_service.create(username="expired")
await magic_link_service.mark_used(expired_link.token) await magic_link_service.mark_used(expired_link.token)