mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Merge pull request #5447 from kevinansfield/signin-no-email-notification
Provide a more intuitive error message on sign-in for missing email
This commit is contained in:
commit
8fe8f8a07b
2 changed files with 16 additions and 2 deletions
|
@ -4,7 +4,9 @@ var SigninValidator = Ember.Object.create({
|
||||||
var data = model.getProperties('identification', 'password'),
|
var data = model.getProperties('identification', 'password'),
|
||||||
validationErrors = [];
|
validationErrors = [];
|
||||||
|
|
||||||
if (!validator.isEmail(data.identification)) {
|
if (validator.empty(data.identification)) {
|
||||||
|
validationErrors.push('Please enter an email');
|
||||||
|
} else if (!validator.isEmail(data.identification)) {
|
||||||
validationErrors.push('Invalid Email');
|
validationErrors.push('Invalid Email');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ CasperTest.begin('Authenticated user is redirected', 6, function suite(test) {
|
||||||
});
|
});
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
CasperTest.begin('Ensure email field form validation', 3, function suite(test) {
|
CasperTest.begin('Ensure email field form validation', 4, function suite(test) {
|
||||||
CasperTest.Routines.signout.run(test);
|
CasperTest.Routines.signout.run(test);
|
||||||
|
|
||||||
casper.thenOpenAndWaitForPageLoad('signin', function testTitleAndUrl() {
|
casper.thenOpenAndWaitForPageLoad('signin', function testTitleAndUrl() {
|
||||||
|
@ -134,4 +134,16 @@ CasperTest.begin('Ensure email field form validation', 3, function suite(test) {
|
||||||
}, function onTimeout() {
|
}, function onTimeout() {
|
||||||
test.fail('Email validation error did not appear');
|
test.fail('Email validation error did not appear');
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
|
casper.then(function testMissingEmail() {
|
||||||
|
this.fillAndSave('form.gh-signin', {
|
||||||
|
identification: ''
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
casper.waitForSelectorTextChange('.notification-error', function onSuccess() {
|
||||||
|
test.assertSelectorHasText('.notification-error', 'Please enter an email', '.notification-error text is correct');
|
||||||
|
}, function onTimeout() {
|
||||||
|
test.fail('Missing Email validation error did not appear');
|
||||||
|
}, 2000);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
Loading…
Reference in a new issue