|
@@ -510,7 +510,7 @@ describe('event form attribute callback global', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('call data-bv-onerror', function() {
|
|
it('call data-bv-onerror', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('a@b@c@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('form eventForm is invalid');
|
|
expect($('#msg').html()).toEqual('form eventForm is invalid');
|
|
|
});
|
|
});
|
|
@@ -544,7 +544,7 @@ describe('event form attribute callback namespace', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('call data-bv-onerror', function() {
|
|
it('call data-bv-onerror', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('just"not"right@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('TestSuite.Event.onFormInvalid() called, form eventForm is invalid');
|
|
expect($('#msg').html()).toEqual('TestSuite.Event.onFormInvalid() called, form eventForm is invalid');
|
|
|
});
|
|
});
|
|
@@ -585,7 +585,7 @@ describe('event form trigger', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('trigger error.form.bv', function() {
|
|
it('trigger error.form.bv', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('this is"not\\allowed@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('form eventForm triggered error.form.bv event');
|
|
expect($('#msg').html()).toEqual('form eventForm triggered error.form.bv event');
|
|
|
});
|
|
});
|
|
@@ -626,7 +626,7 @@ describe('event form programmatically', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('call onError()', function() {
|
|
it('call onError()', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('Abc.example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('onError() called');
|
|
expect($('#msg').html()).toEqual('onError() called');
|
|
|
});
|
|
});
|
|
@@ -678,7 +678,7 @@ describe('event field attribute callback global', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('call data-bv-onerror', function() {
|
|
it('call data-bv-onerror', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('A@b@c@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('email is invalid');
|
|
expect($('#msg').html()).toEqual('email is invalid');
|
|
|
expect($('#status').html()).toEqual(this.bv.STATUS_INVALID);
|
|
expect($('#status').html()).toEqual(this.bv.STATUS_INVALID);
|
|
@@ -715,7 +715,7 @@ describe('event field attribute callback namespace', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('call data-bv-onerror', function() {
|
|
it('call data-bv-onerror', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('a"b(c)d,e:f;gi[j\\k]l@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('TestSuite.Event.onEmailInvalid() called, email is invalid');
|
|
expect($('#msg').html()).toEqual('TestSuite.Event.onEmailInvalid() called, email is invalid');
|
|
|
expect($('#status').html()).toEqual('TestSuite.Event.onEmailStatus() called; status = ' + this.bv.STATUS_INVALID);
|
|
expect($('#status').html()).toEqual('TestSuite.Event.onEmailStatus() called; status = ' + this.bv.STATUS_INVALID);
|
|
@@ -757,7 +757,7 @@ describe('event field trigger', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('trigger error.field.bv', function() {
|
|
it('trigger error.field.bv', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('just"not"right@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('triggered error.field.bv on email');
|
|
expect($('#msg').html()).toEqual('triggered error.field.bv on email');
|
|
|
});
|
|
});
|
|
@@ -802,7 +802,7 @@ describe('event field programmatically', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('call onError()', function() {
|
|
it('call onError()', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('this is"not\\allowed@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('onError() called');
|
|
expect($('#msg').html()).toEqual('onError() called');
|
|
|
});
|
|
});
|
|
@@ -859,13 +859,13 @@ describe('event form trigger with default events', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('does not trigger bv.form.error', function() {
|
|
it('does not trigger bv.form.error', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('A@b@c@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).not.toEqual('form eventForm1 triggered bv.form.error event');
|
|
expect($('#msg').html()).not.toEqual('form eventForm1 triggered bv.form.error event');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('triggers error.form.bv', function() {
|
|
it('triggers error.form.bv', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('A@b@c@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('form eventForm1 triggered error.form.bv event');
|
|
expect($('#msg').html()).toEqual('form eventForm1 triggered error.form.bv event');
|
|
|
});
|
|
});
|
|
@@ -918,13 +918,13 @@ describe('event field trigger with default events', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('does not trigger error.field.bv', function() {
|
|
it('does not trigger error.field.bv', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('just"not"right@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('triggered error.field.bv on email');
|
|
expect($('#msg').html()).toEqual('triggered error.field.bv on email');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('triggers bv.field.error', function() {
|
|
it('triggers bv.field.error', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('just"not"right@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).not.toEqual('triggered bv.field.error on email');
|
|
expect($('#msg').html()).not.toEqual('triggered bv.field.error on email');
|
|
|
});
|
|
});
|
|
@@ -995,7 +995,7 @@ describe('event form trigger with events changed', function() {
|
|
|
it('triggers bv.form.error', function() {
|
|
it('triggers bv.form.error', function() {
|
|
|
spyOn(window, 'onerror');
|
|
spyOn(window, 'onerror');
|
|
|
|
|
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('this is"not\\allowed@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('form eventForm2 triggered bv.form.error event');
|
|
expect($('#msg').html()).toEqual('form eventForm2 triggered bv.form.error event');
|
|
|
|
|
|
|
@@ -1066,7 +1066,7 @@ describe('event field trigger with events changed', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('does not trigger error.field.bv', function() {
|
|
it('does not trigger error.field.bv', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('Abc.example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).not.toEqual('triggered error.field.bv on email');
|
|
expect($('#msg').html()).not.toEqual('triggered error.field.bv on email');
|
|
|
});
|
|
});
|
|
@@ -1074,7 +1074,7 @@ describe('event field trigger with events changed', function() {
|
|
|
it('triggers bv.field.error', function() {
|
|
it('triggers bv.field.error', function() {
|
|
|
spyOn(window, 'onerror');
|
|
spyOn(window, 'onerror');
|
|
|
|
|
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('Abc.example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('triggered bv.field.error on email');
|
|
expect($('#msg').html()).toEqual('triggered bv.field.error on email');
|
|
|
|
|
|
|
@@ -1122,7 +1122,7 @@ describe('event validator declarative', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('trigger data-bv-emailaddress-onerror', function() {
|
|
it('trigger data-bv-emailaddress-onerror', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('A@b@c@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('emailAddress validator did not pass');
|
|
expect($('#msg').html()).toEqual('emailAddress validator did not pass');
|
|
|
});
|
|
});
|
|
@@ -1172,7 +1172,7 @@ describe('event validator programmatically', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('call onError()', function() {
|
|
it('call onError()', function() {
|
|
|
- this.$email.val('email@domain');
|
|
|
|
|
|
|
+ this.$email.val('A@b@c@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect($('#msg').html()).toEqual('emailAddress validator: onError() called');
|
|
expect($('#msg').html()).toEqual('emailAddress validator: onError() called');
|
|
|
});
|
|
});
|
|
@@ -1714,7 +1714,7 @@ describe('i18n', function() {
|
|
|
expect(this.bv.getMessages('username', 'different')[0]).toEqual(i18n.different['default']);
|
|
expect(this.bv.getMessages('username', 'different')[0]).toEqual(i18n.different['default']);
|
|
|
|
|
|
|
|
this.bv.resetForm();
|
|
this.bv.resetForm();
|
|
|
- this.$email.val('invalid#email@address');
|
|
|
|
|
|
|
+ this.$email.val('A@b@c@example.com');
|
|
|
this.bv.validate();
|
|
this.bv.validate();
|
|
|
expect(this.bv.getMessages(this.$email, 'emailAddress')[0]).toEqual(i18n.emailAddress['default']);
|
|
expect(this.bv.getMessages(this.$email, 'emailAddress')[0]).toEqual(i18n.emailAddress['default']);
|
|
|
|
|
|
|
@@ -2615,6 +2615,7 @@ describe('emailAddress', function() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
var validEmailAddresses = [
|
|
var validEmailAddresses = [
|
|
|
|
|
+ 'admin@mailserver1',
|
|
|
'niceandsimple@example.com',
|
|
'niceandsimple@example.com',
|
|
|
'very.common@example.com',
|
|
'very.common@example.com',
|
|
|
'a.little.lengthy.but.fine@dept.example.com',
|
|
'a.little.lengthy.but.fine@dept.example.com',
|
|
@@ -2628,7 +2629,6 @@ describe('emailAddress', function() {
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
var invalidEmailAddresses = [
|
|
var invalidEmailAddresses = [
|
|
|
- 'admin@mailserver1',
|
|
|
|
|
// "!#$%&'*+-/=?^_`{}|~@example.org", // This is actually passing validation; see https://github.com/nghuuphuoc/bootstrapvalidator/issues/673
|
|
// "!#$%&'*+-/=?^_`{}|~@example.org", // This is actually passing validation; see https://github.com/nghuuphuoc/bootstrapvalidator/issues/673
|
|
|
'üñîçøðé@üñîçøðé.com',
|
|
'üñîçøðé@üñîçøðé.com',
|
|
|
'Abc.example.com',
|
|
'Abc.example.com',
|