LT-97: - Remove zxcvbn package because of version conflict,

- Add passwordOptions in ActiveEntry.configure
- Toggle showPasswordStrengthIndicator to show password strength meter ui, toggle requireRegexValidation to set password regex for validation or requireStrongPasswords to create strong passwords by using zxcvbn.
- Sign in/ sing up when enter key is pressed
This commit is contained in:
Aysel Afsar committed 2016-02-11 08:48:11 -05:00
1 parent 5ec3cace94
commit 24e615da1e
15 files changed
+997 -733

No files matched your search

@@ -69,13 +69,20 @@ describe('clinical:active-entry', function () {
});
// ActiveEntry.verifyConfirmPassword
it('Password match validation confirms that two passwords are the same.', function () {
it('Password match confirms that two passwords are the same.', function () {
return client.execute(function (a) {
ActiveEntry.verifyConfirmPassword('K1tt#kittens', 'kittens');
expect(ActiveEntry.errorMessages.get('confirm')).to.equal("Passwords do not match");
ActiveEntry.verifyConfirmPassword('kittens123', 'kittens');
expect(ActiveEntry.errorMessages.get('confirm')).to.equal("Passwords do not match");
ActiveEntry.verifyConfirmPassword('kittens123', 'kittens123');
expect(ActiveEntry.errorMessages.get('confirm')).to.equal("Passwords match");
ActiveEntry.verifyConfirmPassword('K1tt#ns123', 'K1tt#ns123');
expect(ActiveEntry.successMessages.get('confirm')).to.equal("Passwords match");
});
});
@@ -94,13 +101,28 @@ describe('clinical:active-entry', function () {
});
// // ActiveEntry.signIn
// it('Newly created user record should have role, profile, and name set.', function () {
// return client.execute(function () {
// ActiveEntry.signUp('janedoe@test.org', 'Janed*e123', 'Janed*e123', 'Jane Doe');
// expect(ActiveEntry.successMessages.get('fullName')).to.equal("Name present");
// }).then(function (){
// return server.wait(500, 'until account is created on the server', function () {
// return Meteor.users.findOne({'emails.address': 'janedoe@test.org'});
// }).then(function (user){
// expect(user.role).to.equal('user');
// expect(user.profile.fullName).to.equal('Jane Doe');
// });
// });
// });
// ActiveEntry.signIn
it('Newly created user record should have role, profile, and name set.', function () {
return client.execute(function () {
ActiveEntry.signUp('janedoe@test.org', 'Janed*e123', 'Janed*e123', 'Jane Doe');
// ActiveEntry.signUp('janedoe@test.org', 'Janed*e123', 'Janed*e123', 'Jane Doe');
ActiveEntry.signUp('janedoe@test.org', 'Janedoe123', 'Janedoe123', 'Jane Doe');
expect(ActiveEntry.successMessages.get('fullName')).to.equal("Name present");
}).then(function (){
return server.wait(300, 'until account is created on the server', function () {
return server.wait(500, 'until account is created on the server', function () {
return Meteor.users.findOne({'emails.address': 'janedoe@test.org'});
}).then(function (user){
expect(user.role).to.equal('user');
@@ -110,7 +132,6 @@ describe('clinical:active-entry', function () {
});
it("Newly created user should have fullName(), preferredName(), and familyName() methods.", function () {
return server.execute(function () {
var user = Meteor.users.findOne({'emails.address': 'janedoe@test.org'});
@@ -118,12 +139,12 @@ describe('clinical:active-entry', function () {
expect(user.fullName()).to.equal('Jane Doe');
expect(user.givenName()).to.equal('Jane');
expect(user.familyName()).to.equal('Doe');
}).then(function(){
}).then(function (){
// client.wait(500, "until user is logged out", function(){
// Meteor.logout();
// });
return client.promise(function (resolve){
Meteor.logout(function(error, result){
Meteor.logout(function (error, result){
resolve();
});
});
@@ -15,6 +15,7 @@
// existing user should be able to sign in on desktop
// existing user should be able to sign in on tablet
// existing user should be able to sign in on phone
// existing user should be able to change their password
// company logo should display on sign//in page
@@ -48,7 +49,6 @@ module.exports = {
.verify.elementPresent("#signUpPagePasswordInput")
.verify.elementPresent("#signUpPageJoinNowButton");
},
"guest should be notified if password is insecure": function (client) {
client
.clearValue("input")
@@ -158,8 +158,44 @@ module.exports = {
.click("#logoutButton").pause(200)
.verify.containsText("#usernameLink", "Sign In");
},
"if anonymous user tries to log in with non-existing account, a message is shown": function (
client) {
"existing user should be able to change their password" : function (client) {
client
.url("http://localhost:3000/entrySignIn")
.resizeWindow(1600, 1200)
.verify.containsText("#usernameLink", "Sign In")
.signIn("janicedoe@symptomatic.io", "janicedoe123").pause(500)
.verify.containsText("#usernameLink", "janicedoe@symptomatic.io")
.url("http://localhost:3000/changePassword")
.verify.elementPresent("#changePasswordPageOldPasswordInput")
.verify.elementPresent("#changePasswordPagePasswordInput")
.verify.elementPresent("#changePasswordPagePasswordConfirmInput")
.verify.elementPresent("#changePasswordButton")
},
"existing user should be notified if desired new password is insecure" : function (client) {
client
.url("http://localhost:3000/entrySignIn")
.resizeWindow(1600, 1200)
.verify.containsText("#usernameLink", "Sign In")
.signIn("janicedoe@symptomatic.io", "janicedoe123").pause(500)
.verify.containsText("#usernameLink", "janicedoe@symptomatic.io")
.url("http://localhost:3000/changePassword")
.verify.elementPresent("#changePasswordPageOldPasswordInput")
.verify.elementPresent("#changePasswordPagePasswordInput")
.verify.elementPresent("#changePasswordPagePasswordConfirmInput")
.verify.elementPresent("#changePasswordButton")
.verify.cssProperty('#changePasswordPagePasswordInput', 'border', '1px solid gray')
.setValue("#changePasswordPagePasswordInput", "jan")
.verify.cssProperty('#changePasswordPagePasswordInput', 'border', '1px solid rgb(242, 222, 222)')
.setValue("#changePasswordPagePasswordInput", "icedoe123")
.verify.cssProperty('#changePasswordPagePasswordInput', 'border', '1px solid green')
.verify.cssProperty('#changePasswordPagePasswordConfirmInput', 'border', '1px solid gray')
.setValue("#changePasswordPagePasswordConfirmInput", "ja")
.verify.cssProperty('#changePasswordPagePasswordConfirmInput', 'border', '1px solid rgb(242, 222, 222)')
.clearValue("#changePasswordPagePasswordConfirmInput")
.setValue("#changePasswordPagePasswordConfirmInput", "janicedoe123")
.verify.cssProperty('#changePasswordPagePasswordConfirmInput', 'border', '1px solid green')
},
"if anonymous user tries to log in with non-existing account, a message is shown" : function (client) {
client
.url("http://localhost:3000/entrySignIn")
.resizeWindow(1024, 768)