Task Summary
Create local-login.component.spec.ts for frontend/src/app/hub/component/about/local-login/local-login.component.ts.
Behavior to cover:
- Form construction — allForms includes loginUsername, registerUsername, loginPassword, registerPassword, registerConfirmationPassword with the correct validators (required, minLength(6), and the custom confirmationValidator).
- confirmationValidator — returns { confirm: true } when registerConfirmationPassword differs from registerPassword, {} otherwise.
- updateConfirmValidator — schedules updateValueAndValidity on registerConfirmationPassword via setTimeout.
- ngOnInit — when GuiConfigService.env.defaultLocalUser has keys, patches loginUsername and loginPassword from it.
- login — short-circuits and sets loginErrorMessage when UserService.validateUsername fails; otherwise calls UserService.login(username.trim(), password), navigates to queryParams.returnUrl or DASHBOARD_USER_WORKFLOW on success, and on error calls NotificationService.error with the error's message or "Incorrect username or password".
- register — validates password length ≥ 6, password match, and validateUsername; on success calls UserService.register and surfaces a success notification; on error surfaces NotificationService.error with the error message or "Registration failed".
Task Type
Task Summary
Create local-login.component.spec.ts for frontend/src/app/hub/component/about/local-login/local-login.component.ts.
Behavior to cover:
Task Type