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

Commit 15b11e6

Browse files
committed
Added Protractor tests and fixed issue #36
- Added full End-to-End tests for all available Validators with Protractor for both the Directive & Service - Fixed issue #36 where the bower.json scripts order was incorrect - Fixed a few minor bugs found when buildint Protractor tests - Changed all location translation :param with {0}, {1} to follow a better standard as C# String.Format()
1 parent 1068062 commit 15b11e6

24 files changed

+2342
-223
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ myApp.controller('CtrlValidationService', ['$scope', '$translate', 'validationSe
105105
.addValidator('input14', 'alpha|required')
106106
.addValidator('input15', 'alpha|min_len:3|required')
107107
.addValidator('input16', 'match:input15,Password|required')
108-
.addValidator({elmName: 'input17', rules: 'alpha_spaces|exact_len:3|required', debounce: 5000})
108+
.addValidator({elmName: 'input17', rules: 'alpha_spaces|exact_len:3|required', debounce: 3000})
109109
.addValidator('input18', 'date_iso_min:2001-01-01|required')
110110
.addValidator('input19', 'date_us_short_between:11/28/99,12/31/15|required')
111111
.addValidator('area1', 'alpha_dash_spaces|min_len:15|required');

bower.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.3.23",
3+
"version": "1.3.24",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": [
77
"locales/validation/en.js",
88
"locales/validation/fr.js",
9-
"dist/angular-validation-allin1.min.js",
10-
"dist/validation-common.min.js",
11-
"dist/validation-directive.min.js",
12-
"dist/validation-rules.min.js",
13-
"dist/validation-service.min.js",
14-
"src/validation-common.js",
9+
"dist/angular-validation.min.js",
1510
"src/validation-directive.js",
11+
"src/validation-common.js",
1612
"src/validation-rules.js",
1713
"src/validation-service.js"
1814
],

changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ Angular-Validation change logs
2424
1.3.20 (2015-04-21) Fixed issue #26 - validation of forms inside ng-repeat (added sample `dynamicFormView` in `more-examples` folder). And again issue #28 - unbind all 'blur' in cancelValidation() might affect other modules.
2525
1.3.21 (2015-04-29) Moved the Alternate Text inside the $translate promise as well which removes possible delay of non-translated text appearing as alternate text (this will not affect regular text, or already translated text). Also cleanup code and made my Gulp task even more automated.
2626
1.3.22 (2015-05-03) Added new element attribute of `friendly-name` which is used ONLY in the ValidationSummary, this friendly name is to give a better element name display, which also support translation, inside the ValidationSummary instead of just "input1" (see ValidationSummary for more details).
27-
1.3.23 (2015-05-05) Added option to display only last error message instead of all messages at once. Fixed a bug where changing route on View/Controller would make the ValidationSummary fail when coming back to original View/Controller, this bug was associated to the fact that the ValidationSummary kept growing from Controller to Controller, now this ValidationSummary is wipe out as soon as we detect a route change.
27+
1.3.23 (2015-05-05) Added option to display only last error message instead of all messages at once. Fixed a bug where changing route on View/Controller would make the ValidationSummary fail when coming back to original View/Controller, this bug was associated to the fact that the ValidationSummary kept growing from Controller to Controller, now this ValidationSummary is wipe out as soon as we detect a route change.
28+
1.3.24 (2015-05-17) Replaced all `:param` inside each locale translations with a better standard of {0}, {1}, etc.. like C# `String.Format()`. Added a full Protractor End-to-End test suite (1000+ asserts). Fixed a few minor bugs found with Protractor test cases. Fixed issue #36, bower.json scripts in wrong order.

dist/angular-validation.min.js

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

full-tests/Directive.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h3>Directive</h3>
2+
3+
<div class="checkbox text-right" style="margin-top:-25px">
4+
<label>
5+
<input type="checkbox" ng-model="displayValidationSummary"> {{ 'SHOW_VALIDATION_SUMMARY' | translate }}
6+
</label>
7+
</div>
8+
9+
<hr />
10+
11+
<!-- Angular-Validation saves the summary of errors inside 2 locations: 1- $scope.$validationSummary 2- $scope.formName.$validationSummary (only accessible if you named your form) so it becomes easy to show all errors -->
12+
<div class="alert alert-danger alert-dismissable" ng-show="displayValidationSummary && form01.$validationSummary.length > 0">
13+
<button type="button" class="close" data-dismiss="alert" aria-hidden="true" ng-click="displayValidationSummary = false">&times;</button>
14+
<h4><strong>{{ 'ERRORS' | translate }}!</strong></h4>
15+
<ul>
16+
<li ng-repeat="item in form01.$validationSummary">{{ item.friendlyName != '' ? item.friendlyName : item.field }}: {{item.message}}</li>
17+
</ul>
18+
</div>
19+
20+
<form novalidate name="form01" method="POST">
21+
<div class="form-group row" ng-repeat="v in validations">
22+
<label for="input{{$index}}">input{{$index}}</label>
23+
<input class="form-control" type="text" name="input{{$index}}" ng-model="v.input$index" validation="required|{{v.validation == 'required' ? '' : v.validation}}">
24+
</div>
25+
26+
<div class="form-actions">
27+
<button type="submit" name="save_btn" class="btn btn-primary" ng-disabled="form01.$invalid">{{ 'SAVE' | translate }} (ngDisabled)</button>
28+
<button type="submit" name="save_btn" class="btn btn-primary" ng-click="submitForm()">{{ 'SAVE' | translate }} (ngSubmit)</button>
29+
</div>
30+
</form>

0 commit comments

Comments
 (0)