mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 11:30:55 +03: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
@ -4,7 +4,9 @@ var SigninValidator = Ember.Object.create({
|
||||
var data = model.getProperties('identification', 'password'),
|
||||
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');
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ CasperTest.begin('Authenticated user is redirected', 6, function suite(test) {
|
||||
});
|
||||
}, 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);
|
||||
|
||||
casper.thenOpenAndWaitForPageLoad('signin', function testTitleAndUrl() {
|
||||
@ -134,4 +134,16 @@ CasperTest.begin('Ensure email field form validation', 3, function suite(test) {
|
||||
}, function onTimeout() {
|
||||
test.fail('Email validation error did not appear');
|
||||
}, 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);
|
||||
|
Loading…
Reference in New Issue
Block a user