diff options
| author | Misko Hevery | 2010-12-01 20:29:54 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-12-02 22:45:57 -0800 |
| commit | 5a8ad8fe329fc09898ff43a060710265d38393be (patch) | |
| tree | 95058036d40b1dd993e2a9c4094ebd34b2751707 /test/testabilityPatch.js | |
| parent | 41d5938883a3d06ffe8a88a51efd8d1896f7d747 (diff) | |
| download | angular.js-5a8ad8fe329fc09898ff43a060710265d38393be.tar.bz2 | |
Closes #170. Corrected the behavior of select when options are ng:repeated
- Delete $postEval method, as it was a hack
Diffstat (limited to 'test/testabilityPatch.js')
| -rw-r--r-- | test/testabilityPatch.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index e8041ac7..ea5c8ab7 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -50,6 +50,25 @@ beforeEach(function(){ }); }); +afterEach(clearJqCache); + +function clearJqCache(){ + var count = 0; + foreachSorted(jqCache, function(value, key){ + count ++; + delete jqCache[key]; + foreach(value, function(value, key){ + if (value.$element) + dump(key, sortedHtml(value.$element)); + else + dump(key, toJson(value)); + }); + }); + if (count) { + fail('Found jqCache references that were not deallocated!'); + } +} + function nakedExpect(obj) { return expect(angular.fromJson(angular.toJson(obj))); } @@ -58,6 +77,11 @@ function childNode(element, index) { return jqLite(element[0].childNodes[index]); } +function dealoc(obj) { + var element = (obj||{}).$element || obj; + if (element && element.dealoc) element.dealoc(); +} + extend(angular, { 'element': jqLite, 'compile': compile, |
