Ma77Ball opened a new pull request, #5235:
URL: https://github.com/apache/texera/pull/5235

   ### What changes were proposed in this PR?
   - Add `local-login.component.spec.ts` to cover form construction, 
validators, default-user prefill, and the login/register flows that were 
previously untested.
   - Tests assert that `allForms` exposes the five expected controls with 
`required`, `minLength(6)`, and the custom `confirmationValidator`, that 
`confirmationValidator` returns `{ confirm: true }` on mismatch and `{}` on 
match, and that `updateConfirmValidator` schedules `updateValueAndValidity` on 
the confirmation control via `setTimeout`.
   - Tests assert that `ngOnInit` patches `loginUsername`/`loginPassword` only 
when `GuiConfigService.env.defaultLocalUser` is populated, that `login` 
short-circuits via `loginErrorMessage` on validation failure and otherwise 
calls `UserService.login` with the trimmed username and navigates to 
`queryParams.returnUrl` or `DASHBOARD_USER_WORKFLOW`, and that error paths 
surface the error's message (or the fallback `"Incorrect username or 
password"`) through `NotificationService.error`.
   - Tests assert that `register` enforces password length, password match, and 
`UserService.validateUsername`, calls `UserService.register` with the trimmed 
username on success and surfaces the account-created notification, and on error 
notifies with the error's message (or the fallback `"Registration failed"`).
   ### Any related issues, documentation, or discussions?
   Closes: #5226
   ### How was this PR tested?
   - `yarn test 
--include="src/app/hub/component/about/local-login/local-login.component.spec.ts"`,
 22 tests passing.
   - `yarn format:fix`, 506 files unchanged.
   ### Was this PR authored or co-authored using generative AI tooling?
   Co-authored with Claude Opus 4.7 in compliance with ASF


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to