refactor: remove unused Pinia stores and related code
- Deleted the layout-store, profiles-store, and index.ts files from the Pinia store setup. - Removed the zod-sync script as it is no longer needed. - Cleaned up the tsconfig.json file by removing unnecessary references. - Updated the login logic in the profiles package to use polling for login results instead of in-process waiters. - Added validation methods for personal data and profile parameters. - Introduced new tests for validation logic in profiles and registration packages. - Enhanced email normalization and validation in the registration package.
This commit is contained in:
26
registration/validation_test.go
Normal file
26
registration/validation_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package registration
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNormalizeEmail(t *testing.T) {
|
||||
got, err := normalizeEmail(" Alice@Example.com ")
|
||||
if err != nil {
|
||||
t.Fatalf("normalizeEmail() returned unexpected error: %v", err)
|
||||
}
|
||||
if got != "alice@example.com" {
|
||||
t.Fatalf("normalizeEmail() = %q, want %q", got, "alice@example.com")
|
||||
}
|
||||
|
||||
if _, err := normalizeEmail(" "); err == nil {
|
||||
t.Fatal("normalizeEmail() should reject empty email")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPasswordResetConfirmParamsValidate(t *testing.T) {
|
||||
if err := (&PasswordResetConfirmParams{Password: "weak"}).Validate(); err == nil {
|
||||
t.Fatal("Validate() should reject weak password")
|
||||
}
|
||||
if err := (&PasswordResetConfirmParams{Password: "validpass"}).Validate(); err != nil {
|
||||
t.Fatalf("Validate() returned unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user