diff options
| author | Misko Hevery | 2010-03-29 21:36:34 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2010-03-29 21:36:34 -0700 | 
| commit | cc6def854f2c77d0a7fea177df0dca858b8cd943 (patch) | |
| tree | a47a1b9837ebbc5401a4cdcffbecec14737ab9ce /test/ValidatorsTest.js | |
| parent | e55c97debaa0ef8487ece219b6eadbc147ece1f9 (diff) | |
| download | angular.js-cc6def854f2c77d0a7fea177df0dca858b8cd943.tar.bz2 | |
reenabled more tests
Diffstat (limited to 'test/ValidatorsTest.js')
| -rw-r--r-- | test/ValidatorsTest.js | 27 | 
1 files changed, 19 insertions, 8 deletions
diff --git a/test/ValidatorsTest.js b/test/ValidatorsTest.js index 971ff0bb..37be526d 100644 --- a/test/ValidatorsTest.js +++ b/test/ValidatorsTest.js @@ -91,24 +91,35 @@ describe('Validator:asynchronous', function(){      value = null;      fn = null;      self = { -        $element:jqLite('<input />')[0], +        $element:jqLite('<input />'),          $invalidWidgets:[],          $updateView: noop      };    }); -  xit('should make a request and show spinner', function(){ -    var x = compile('<input name="name" ng-validate="asynchronous:asyncFn"/>'); -    var asyncFn = function(v,f){value=v; fn=f;}; -    var input = x.node.find(":input"); -    x.scope.$set("asyncFn", asyncFn); -    x.scope.$set("name", "misko"); -    x.scope.$eval(); +  afterEach(function(){ +    if (self.$element) self.$element.remove(); +    var oldCache = jqCache; +    jqCache = {}; +    expect(size(oldCache)).toEqual(0); +  }); + +  it('should make a request and show spinner', function(){ +    var value, fn; +    var scope = angular.compile('<input type="text" name="name" ng-validate="asynchronous:asyncFn"/>'); +    scope.$init(); +    var input = scope.$element; +    scope.asyncFn = function(v,f){ +      value=v; fn=f; +    }; +    scope.name = "misko"; +    scope.$eval();      expect(value).toEqual('misko');      expect(input.hasClass('ng-input-indicator-wait')).toBeTruthy();      fn("myError");      expect(input.hasClass('ng-input-indicator-wait')).toBeFalsy();      expect(input.attr('ng-error')).toEqual("myError"); +    scope.$element.remove();    });    it("should not make second request to same value", function(){  | 
