diff options
Diffstat (limited to 'test/servicesSpec.js')
| -rw-r--r-- | test/servicesSpec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 43511853..b7dfe4c8 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -54,3 +54,23 @@ describe("services", function(){ }); }); + +describe("service $invalidWidgets", function(){ + var scope; + beforeEach(function(){ + scope = null; + }); + afterEach(function(){ + if (scope && scope.$element) + scope.$element.remove(); + }); + + it("should count number of invalid widgets", function(){ + var scope = compile('<input name="price" ng-required></input>').$init(); + expect(scope.$invalidWidgets.length).toEqual(1); + scope.price = 123; + scope.$eval(); + expect(scope.$invalidWidgets.length).toEqual(0); + scope.$element.remove(); + }); +}); |
