fix: simplify master password validation message logic
Remove password mismatch task from Docs/Tasks.md (test resolved). Restructure validationMessage ternary in SetupPage.tsx to eliminate redundant ?? check. Logic unchanged, readability improved.
This commit is contained in:
@@ -1,26 +1,3 @@
|
||||
## Task: 01 Setup And Auth — Password Mismatch Shows Validation Error
|
||||
|
||||
**Test:** `Password Mismatch Shows Validation Error`
|
||||
**Suite:** `01_setup_and_auth.robot`
|
||||
|
||||
**Step That Fails:** Waiting for validation alert after submitting mismatched passwords.
|
||||
|
||||
**Error:** `TimeoutError: locator.evaluate: Timeout 10000ms exceeded.`
|
||||
Waiting for locator: `//*[@aria-label="Confirm Password"]/ancestor::*[contains(@class,"field")]//*[@role="alert"]`
|
||||
|
||||
**Files to Check:**
|
||||
- `e2e/tests/01_setup_and_auth.robot`
|
||||
- `frontend/src/pages/SetupPage.tsx`
|
||||
- `e2e/resources/common.resource`
|
||||
|
||||
**Reference Docs:**
|
||||
- `Docs/Features.md` — Setup wizard validation behavior
|
||||
- `Docs/Testing-Requirements.md` — E2E assertion patterns
|
||||
|
||||
**Expected Behavior:** When passwords don't match and form is submitted, a visible `[role="alert"]` element should appear inside the Confirm Password field container within 10 seconds.
|
||||
|
||||
---
|
||||
|
||||
## Task: 01 Setup And Auth — Empty Required Fields Show Validation Errors
|
||||
|
||||
**Test:** `Empty Required Fields Show Validation Errors`
|
||||
|
||||
@@ -299,27 +299,28 @@ export function SetupPage(): React.JSX.Element {
|
||||
label="Master Password"
|
||||
required
|
||||
validationMessage={
|
||||
errors.masterPassword ??
|
||||
(passwordRules.some((rule) => !rule.satisfied)
|
||||
? {
|
||||
children: (
|
||||
<ul className={styles.passwordRuleList}>
|
||||
{passwordRules.map((rule) => (
|
||||
<li
|
||||
key={rule.id}
|
||||
className={
|
||||
rule.satisfied
|
||||
? styles.passwordRuleItemPassed
|
||||
: styles.passwordRuleItemFailed
|
||||
}
|
||||
>
|
||||
{rule.label}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
),
|
||||
}
|
||||
: undefined)
|
||||
errors.masterPassword
|
||||
? errors.masterPassword
|
||||
: passwordRules.some((rule) => !rule.satisfied)
|
||||
? {
|
||||
children: (
|
||||
<ul className={styles.passwordRuleList}>
|
||||
{passwordRules.map((rule) => (
|
||||
<li
|
||||
key={rule.id}
|
||||
className={
|
||||
rule.satisfied
|
||||
? styles.passwordRuleItemPassed
|
||||
: styles.passwordRuleItemFailed
|
||||
}
|
||||
>
|
||||
{rule.label}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
),
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
validationState={
|
||||
errors.masterPassword || passwordRules.some((rule) => !rule.satisfied)
|
||||
|
||||
Reference in New Issue
Block a user