Skip to content

Commit

Permalink
Remove number validator of first char and add test case for it
Browse files Browse the repository at this point in the history
  • Loading branch information
samaradel committed Oct 13, 2024
1 parent 51465dc commit b9ff25e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/playground/src/components/smtp_server.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
validators.isEmail('Please provide a valid email address.')(v) &&
(validators.IsAlphaExpectDashAndUnderscore(
'Username should consist of letters, dashs and underscores only.'
)(v) || validators.isAlpha('Username must start with an alphabetical character.')(v[0]))
)(v))
);
},
]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ describe("IsAlphaExpectDashAndUnderscore", () => {
const result = validator("hello");
expect(result).toBeUndefined();
});

it("returns undefined for valid username/email that starts with numbers", () => {
const result = validator("4me");
expect(result).toBeUndefined();
});
});

0 comments on commit b9ff25e

Please sign in to comment.