Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit ba2ba9a

Browse files
committed
If translation isn't working, throw an error
1 parent 72f62bf commit ba2ba9a

19 files changed

+55
-10
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.5.4",
3+
"version": "1.5.5",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": [
@@ -47,4 +47,4 @@
4747
"devDependencies": {
4848
"angular-route": ">= 1.2.0"
4949
}
50-
}
50+
}

dist/angular-validation.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

more-examples/customRemote/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ myApp.controller('CtrlService', ['$scope', '$q', 'ValidationService', function (
6262
var vs = new ValidationService({ controllerAs: vms, debounce: 500 });
6363

6464
vs.setGlobalOptions({ scope: $scope })
65-
.addValidator('input3', 'alpha|min_len:2|remote:vms.myRemoteValidation3():alt=Alternate error message.|required')
65+
.addValidator('input3', 'alpha|min_len:2|remote:vms.myRemoteValidation3:alt=Alternate error message.|required')
6666
.addValidator('input4', 'alpha|min_len:2|remote:vms.myRemoteValidation4()|required');
6767

6868
vms.myRemoteValidation3 = function() {
6969
var deferred = $q.defer();
7070
setTimeout(function() {
7171
var isValid = (vms.model.input3 === "abc") ? true : false;
7272
deferred.resolve({ isValid: isValid, message: 'Returned error from promise.'});
73-
}, 500);
73+
}, 100);
7474

7575
return deferred.promise;
7676
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.5.4",
3+
"version": "1.5.5",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": "app.js",

protractor/angularUI_spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
it('Should enter valid date expect no errors on input and validation summary', function () {
2121
var elmInput = $('[name=dateOfChange]');
2222
elmInput.sendKeys(validDate);
23+
element(by.css('body')).click();
2324
elmInput.sendKeys(protractor.Key.TAB);
2425

2526
// validation summary should become empty
@@ -30,6 +31,7 @@
3031
it('Should enter outside of range date and show dateOfChange error on input and ValidationSummary', function () {
3132
var elmInput = $('[name=dateOfChange]');
3233
elmInput.sendKeys(invalidOverDate);
34+
element(by.css('body')).click();
3335
elmInput.sendKeys(protractor.Key.TAB);
3436

3537
var itemRows = element.all(by.binding('message'));
@@ -43,6 +45,7 @@
4345
it('Should enter wrong date format and show dateOfChange error on input and ValidationSummary', function () {
4446
var elmInput = $('[name=dateOfChange]');
4547
elmInput.sendKeys(invalidTypoDate);
48+
element(by.css('body')).click();
4649
elmInput.sendKeys(protractor.Key.TAB);
4750

4851
var itemRows = element.all(by.binding('message'));

protractor/badInput_spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('Angular-Validation badInput Tests:', function () {
4545
it('Should display same invalid character error message even after a Tab', function() {
4646
// make input3 invalid, remove text
4747
var elmInput2 = $('[name=input2]');
48+
element(by.css('body')).click();
4849
elmInput2.sendKeys(protractor.Key.TAB);
4950

5051
// error should appear on input2
@@ -95,6 +96,7 @@ describe('Angular-Validation badInput Tests:', function () {
9596
var elmInput2 = $('[name=input2]');
9697
elmInput2.click();
9798
clearInput(elmInput2, 5);
99+
element(by.css('body')).click();
98100
elmInput2.sendKeys(protractor.Key.TAB);
99101

100102
// error should appear on input2

protractor/callback_spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('Angular-Validation callback Validation Tests:', function () {
4545
for (var i = 0, ln = formElementNames.length; i < ln; i++) {
4646
var elmInput = $('[name=' + formElementNames[i] + ']');
4747
elmInput.click();
48+
element(by.css('body')).click();
4849
elmInput.sendKeys(protractor.Key.TAB);
4950

5051
var elmError = $('.validation-' + formElementNames[i]);

protractor/conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'browserName': 'chrome',
88
'chromeOptions': {
99
// get rid of --ignore-certificate yellow warning
10-
args: ['--no-sandbox', 'test-type=browser'],
10+
args: ['--no-sandbox', 'test-type=browser', 'disable-extensions'],
1111
// set download path and avoid prompting for download even though
1212
// even though this is already the default Chrome but for completeness
1313
prefs: {

protractor/controllerAsWithRoute_spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
it('Should enter valid data and show 0 error on Top Form Valdation Summary', function () {
2727
var elmInput = $('[name=f1]');
2828
elmInput.sendKeys('abc');
29+
element(by.css('body')).click();
2930
elmInput.sendKeys(protractor.Key.TAB);
3031

3132
// validation summary should become empty
@@ -36,6 +37,7 @@
3637
it('Should enter valid data and show 0 error on bottom Form Valdation Summary in ngView (First Route)', function () {
3738
var elmInput = $('[name=firstField]');
3839
elmInput.sendKeys('abc');
40+
element(by.css('body')).click();
3941
elmInput.sendKeys(protractor.Key.TAB);
4042

4143
// validation summary should become empty
@@ -63,6 +65,7 @@
6365
it('Should enter valid data and show 0 error on bottom Form Valdation Summary in ngView (First Route)', function () {
6466
var elmInput = $('[name=secondField]');
6567
elmInput.sendKeys('abc');
68+
element(by.css('body')).click();
6669
elmInput.sendKeys(protractor.Key.TAB);
6770

6871
// validation summary should become empty

protractor/custom_spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
for (var i = 0, ln = formElementNames.length; i < ln; i++) {
5151
var elmInput = $('[name=' + formElementNames[i] + ']');
5252
elmInput.click();
53+
element(by.css('body')).click();
5354
elmInput.sendKeys(protractor.Key.TAB);
5455

5556
var elmError = $('.validation-' + formElementNames[i]);
@@ -74,6 +75,7 @@
7475
elmInput.click();
7576
clearInput(elmInput);
7677
elmInput.sendKeys(validInputTexts[i]);
78+
element(by.css('body')).click();
7779
elmInput.sendKeys(protractor.Key.TAB);
7880

7981
var elmError = $('.validation-' + formElementNames[i]);
@@ -114,6 +116,7 @@
114116
for (var i = 0, ln = formElementNames.length; i < ln; i++) {
115117
var elmInput = $('[name=' + formElementNames[i] + ']');
116118
elmInput.click();
119+
element(by.css('body')).click();
117120
elmInput.sendKeys(protractor.Key.TAB);
118121

119122
var elmError = $('.validation-' + formElementNames[i]);

0 commit comments

Comments
 (0)