aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/invalidWidgetsSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/service/invalidWidgetsSpec.js')
-rw-r--r--test/service/invalidWidgetsSpec.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/test/service/invalidWidgetsSpec.js b/test/service/invalidWidgetsSpec.js
deleted file mode 100644
index fe7efe38..00000000
--- a/test/service/invalidWidgetsSpec.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict';
-
-describe('$invalidWidgets', function() {
- var scope;
-
- beforeEach(function(){
- scope = angular.scope();
- });
-
-
- afterEach(function(){
- dealoc(scope);
- });
-
-
- it("should count number of invalid widgets", function(){
- var element = jqLite('<input name="price" ng:required ng:validate="number">');
- jqLite(document.body).append(element);
- scope = compile(element)();
- var $invalidWidgets = scope.$service('$invalidWidgets');
- expect($invalidWidgets.length).toEqual(1);
-
- scope.price = 123;
- scope.$digest();
- expect($invalidWidgets.length).toEqual(0);
-
- scope.$element.remove();
- scope.price = 'abc';
- scope.$digest();
- expect($invalidWidgets.length).toEqual(0);
-
- jqLite(document.body).append(scope.$element);
- scope.price = 'abcd'; //force revalidation, maybe this should be done automatically?
- scope.$digest();
- expect($invalidWidgets.length).toEqual(1);
-
- jqLite(document.body).html('');
- scope.$digest();
- expect($invalidWidgets.length).toEqual(0);
- });
-});