This commit is contained in:
@@ -87,7 +87,7 @@ func TestValidatePhone(t *testing.T) {
|
||||
{"valid international", "+1234567890", false, ""},
|
||||
{"valid with country code", "+79123456789", false, ""},
|
||||
{"valid without plus", "1234567890", false, ""},
|
||||
{"empty", "", true, errors.ValidationInvalidPhone},
|
||||
{"empty is valid", "", false, ""},
|
||||
{"too short", "123", true, errors.ValidationInvalidPhone},
|
||||
{"letters", "abcdefgh", true, errors.ValidationInvalidPhone},
|
||||
{"too long", "+123456789012345678901", true, errors.ValidationInvalidPhone},
|
||||
@@ -203,6 +203,7 @@ func TestValidateRegistration(t *testing.T) {
|
||||
wantErr bool
|
||||
}{
|
||||
{"valid", "test@example.com", "Abcd1234", "John Doe", "+1234567890", false},
|
||||
{"valid without phone", "test@example.com", "Abcd1234", "John Doe", "", false},
|
||||
{"invalid email", "invalid", "Abcd1234", "John Doe", "+1234567890", true},
|
||||
{"invalid password", "test@example.com", "weak", "John Doe", "+1234567890", true},
|
||||
{"invalid name", "test@example.com", "Abcd1234", "", "+1234567890", true},
|
||||
|
||||
Reference in New Issue
Block a user