main ← fix-ux-on-finish-installation-form
opened 09:22PM - 12 Dec 25 UTC
When submitting the admin registration form with an invalid password (blank or t…oo short), the password field was not visually highlighted with the error state, making it unclear what was wrong.
Two issues were causing this:
1. Copy-paste error: The password field container was checking `@user.errors[:username]` instead of `@user.errors[:password]`
2. Wrong error key: Password length validation errors from the UserPassword model are stored under `:"user_password.password"`, not `:password`. The template only checked the latter.
Fixed by checking both error keys and displaying all password-related errors with proper visual highlighting.
Added system spec with page object for UI behavior testing and trimmed request spec to cover edge cases that require stubs (like empty developer_emails).
Ref - https://meta.discourse.org/t/381505
Here's how the errors look like
**Blank username & blank password**
<img width="1772" height="1274" alt="CleanShot 2025-12-12 at 22 01 03" src="https://github.com/user-attachments/assets/4a6a3628-7a9b-48ee-bf9e-f6b1baba9b90" />
**Username filled & blank password**
<img width="1772" height="1274" alt="CleanShot 2025-12-12 at 22 01 18" src="https://github.com/user-attachments/assets/fdef8ad1-1aa9-4b12-90d8-aeccc8344fc0" />
**Username filled & short password**
<img width="1772" height="1274" alt="CleanShot 2025-12-12 at 22 01 29" src="https://github.com/user-attachments/assets/2c1c96e4-e5d4-40af-8f33-30ca0e1aafc5" />