From cc6def854f2c77d0a7fea177df0dca858b8cd943 Mon Sep 17 00:00:00 2001
From: Misko Hevery
Date: Mon, 29 Mar 2010 21:36:34 -0700
Subject: reenabled more tests
---
test/ValidatorsTest.js | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
(limited to 'test/ValidatorsTest.js')
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('')[0],
+ $element:jqLite(''),
$invalidWidgets:[],
$updateView: noop
};
});
- xit('should make a request and show spinner', function(){
- var x = compile('');
- 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('');
+ 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(){
--
cgit v1.2.3