aboutsummaryrefslogtreecommitdiffstats
path: root/test/BinderTest.js
diff options
context:
space:
mode:
authorMisko Hevery2010-02-04 13:27:56 -0800
committerMisko Hevery2010-02-04 13:27:56 -0800
commit1da18e73a4d09b2a1ace92a4094eeba014eb7dc4 (patch)
tree5f679ca5b575f29cd5938099a5dab37aa968c85f /test/BinderTest.js
parent5dd43b85e73ca1708e7fd85094b533b02266a79a (diff)
downloadangular.js-1da18e73a4d09b2a1ace92a4094eeba014eb7dc4.tar.bz2
consider widget errors only when widgets are visible
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}}\'}">' +