aboutsummaryrefslogtreecommitdiffstats
path: root/test/BinderTest.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/BinderTest.js')
-rw-r--r--test/BinderTest.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/BinderTest.js b/test/BinderTest.js
index a45183a4..41319b52 100644
--- a/test/BinderTest.js
+++ b/test/BinderTest.js
@@ -788,6 +788,17 @@ BinderTest.prototype.testValidateForm = function() {
assertEquals(0, c.scope.get("$invalidWidgets.length"));
};
+BinderTest.prototype.testValidateOnlyVisibleItems = function(){
+ var c = compile('<input name="name" ng-required><input ng-show="show" name="name" ng-required>');
+ c.scope.set("show", true);
+ c.binder.updateView();
+ assertEquals(2, c.scope.get("$invalidWidgets.length"));
+
+ c.scope.set("show", false);
+ c.binder.updateView();
+ assertEquals(1, c.scope.get("$invalidWidgets.length"));
+};
+
BinderTest.prototype.testDeleteAttributeIfEvaluatesFalse = function() {
var c = compile(
'<input name="a0" ng-bind-attr="{disabled:\'{{true}}\'}"><input name="a1" ng-bind-attr="{disabled:\'{{false}}\'}">' +