Added testing issues for password validation

This commit is contained in:
Aysel Afsar committed 2016-02-03 14:41:51 -05:00
1 parent 236ab64add
commit 4e986c8395
4 files changed
+16 -32

No files matched your search

@@ -48,7 +48,7 @@ Template.entrySignIn.helpers({
return "border: 1px solid #a94442";
} else if (ActiveEntry.errorMessages.equals('email', "Email is poorly formatted")) {
return "border: 1px solid #f2dede";
} else if (ActiveEntry.errorMessages.equals('email', "Email present")) {
} else if (ActiveEntry.successMessages.equals('email', "Email present")) {
return "border: 1px solid green";
} else {
return "border: 1px solid gray";
@@ -59,7 +59,7 @@ Template.entrySignIn.helpers({
return "border: 1px solid #a94442";
} else if (ActiveEntry.errorMessages.equals('password', "Password must have at least 8 characters. It must contain at least 1 uppercase, 1 lowercase, 1 number and 1 special character.")) {
return "border: 1px solid #f2dede";
} else if (ActiveEntry.errorMessages.equals('password', "Password present")) {
} else if (ActiveEntry.successMessages.equals('password', "Password present")) {
return "border: 1px solid green";
} else {
return "border: 1px solid gray";
@@ -29,7 +29,6 @@ Template.entrySignUp.helpers({
return Session.get('defaultSignInMessage');
}
},
entryErrorMessages: function () {
var errorMessages = [];
Object.keys(ActiveEntry.errorMessages.all()).forEach(function(key) {
@@ -39,7 +38,6 @@ Template.entrySignUp.helpers({
});
return errorMessages;
},
getButtonText: function () {
if (ActiveEntry.errorMessages.get('signInError')) {
return ActiveEntry.errorMessages.get('signInError').message;
@@ -127,30 +125,18 @@ Template.entrySignUp.events({
ActiveEntry.verifyFullName(fullName);
ActiveEntry.errorMessages.set('signInError', null);
},
// TODO: this is outdated, and should be changed to match the signature/pattern in entrySignIn
'click #signUpPageJoinNowButton': function (event, template) {
event.preventDefault();
ActiveEntry.reset();
var newUser = {
fullName: template.$('[name="fullName"]').val(),
email: template.$('[name="email"]').val(),
password: template.$('[name="password"]').val(),
confirm: template.$('[name="confirm"]').val()
};
ActiveEntry.signUp(
newUser.email,
newUser.password,
newUser.confirm,
newUser.fullName
$('#signUpPageEmailInput').val(),
$('#signUpPagePasswordInput').val(),
$('#signUpPagePasswordConfirmInput').val(),
$('#signUpPageFullNameInput').val()
);
}
});
Template.entrySignUp.onRendered(function() {
// Password strength meter for password inputs
console.log(passwordValidationSettings)
if (passwordValidationSettings.usePwstrength) {
this.$('#signUpPagePasswordInput').pwstrength(passwordValidationSettings.pwstrengthOptions);
}