aboutsummaryrefslogtreecommitdiffstats
path: root/test/index.html
diff options
context:
space:
mode:
authorTimo Tijhof <krinklemail@gmail.com>2012-10-17 04:33:47 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-10-28 22:44:57 -0400
commit36c9ecb0f50aec9063725b0c45e0cca98ef87084 (patch)
tree27145205cb64f2d366bb0380d9c6c8de616bcb06 /test/index.html
parent8121309694630d3cb29e5b8dc4ad81527a5bb494 (diff)
downloadjquery-36c9ecb0f50aec9063725b0c45e0cca98ef87084.tar.gz
jquery-36c9ecb0f50aec9063725b0c45e0cca98ef87084.zip
Implement expectation test instead of using _removeData. Close gh-997.
* Removed inline usage of QUnit.reset() because it is messing with the expectation model as reset does .empty() which does a recursive cleanData on everything in #qunit-fixture, so any expectJqData above .reset() would fail negatively. Instead of calling reset inline, either updated the following assertions to take previous assertions' state into account, or broke the test() up into 2 tests at the point where it would call QUnit.reset. * After introducing the new memory leak discovery a whole bunch of tests were failing as they didn't clean up everything. However I didn't (yet) add QUnit.expectJqData calls all over the place because in most if not all of these cases it is valid data storage. For example in test "data()", there will be an internal data key for "parsedAttrs". This particular test isn't intending to test for memory leaks, so therefor I made the new discovery system only push failures when the test contains at least 1 call to QUnit.expectJqData. When not, we'll assume that whatever data is being stored is acceptable because the relevant elements still exist in the DOM anyway (QUnit.reset will remove the elements and clean up the data automatically). I did add a "Always check jQuery.data" mode in the test suite that will trigger it everywhere. Maybe one day we'll include a call to everywhere, but for now I'm keeping the status quo: Only consider data left in storage to be a problem if the test says so ("opt-in"). * Had to move #fx-tests inside the fixture because ".remove()" test would otherwise remove stuff permanently and cause random other tests to fail as "#hide div" would yield an empty collection. (Why wasn't this in the fixture in the first place?) As a result moving fx-tests into the fixture a whole bunch of tests failed that relied on arbitrary stuff about the document-wide or fixture-wide state (e.g. number of divs etc.). So I had to adjust various tests to limit their sample data to not be so variable and unlimited... * Moved out tests for expando cleanup into a separate test. * Fixed implied global variable 'pass' in effects.js that was causing "TypeError: boolean is not a function" in *UNRELATED* dimensions.js that uses a global variable "pass = function () {};" ... * Removed spurious calls to _removeData. The new test exposed various failures e.g. where div[0] isn't being assigned any data anyway. (queue.js and attributes.js toggleClass). * Removed spurious clean up at the bottom of test() functions that are already covered by the teardown (calling QUnit.reset or removeClass to supposedly undo any changes). * Documented the parentheses-less magic line in toggleClass. It appeared that it would always keep the current class name if there was any (since the assignment started with "this.className || ...". Adding parentheses + spacing is 8 bytes (though only 1 in gzip apparently). Only added the comment for now, though I prefer clarity with logical operators, I'd rather not face the yayMinPD[1] in this test-related commit. * Updated QUnit urlConfig to the new format (raw string is deprecated). * Clean up odd htmlentities in test titles, QUnit escapes this. (^\s+test\(.*)(&gt\;) → $1> (^\s+test\(.*)(&lt\;) → $1< [1] jQuery MinJsGz Release Police Department (do the same, download less)
Diffstat (limited to 'test/index.html')
-rw-r--r--test/index.html50
1 files changed, 29 insertions, 21 deletions
diff --git a/test/index.html b/test/index.html
index b8e6ff799..53dec94c0 100644
--- a/test/index.html
+++ b/test/index.html
@@ -17,12 +17,20 @@
(function() {
var src = "../dist/jquery.js";
- QUnit.config.urlConfig.push( "min" );
+ QUnit.config.urlConfig.push( {
+ id: "min",
+ label: "Load minified",
+ tooltip: "Load the minified version of the jQuery build"
+ } );
if ( QUnit.urlParams.min ) {
src = "../dist/jquery.min.js";
}
- QUnit.config.urlConfig.push( "noqsa" );
+ QUnit.config.urlConfig.push( {
+ id: "noqsa",
+ label: "Disable querySelectorAll",
+ tooltip: "Disable the native document.querySelectorAll"
+ } );
if ( QUnit.urlParams.noqsa ) {
document.querySelectorAll = null;
}
@@ -281,34 +289,34 @@ Z</textarea>
</em>
<span id="siblingspan"></span>
</div>
- </div>
- </dl>
- <div id="fx-test-group" style="position:absolute;width:1px;height:1px;overflow:hidden;">
- <div id="fx-queue" name="test">
- <div id="fadein" class='chain test' name='div'>fadeIn<div>fadeIn</div></div>
- <div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>
+ <div id="fx-test-group" style="position:absolute;width:1px;height:1px;overflow:hidden;">
+ <div id="fx-queue" name="test">
+ <div id="fadein" class='chain test' name='div'>fadeIn<div>fadeIn</div></div>
+ <div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>
- <div id="show" class='chain test'>show<div>show</div></div>
- <div id="hide" class='chain test out'>hide<div>hide</div></div>
+ <div id="show" class='chain test'>show<div>show</div></div>
+ <div id="hide" class='chain test out'>hide<div>hide</div></div>
- <div id="togglein" class='chain test'>togglein<div>togglein</div></div>
- <div id="toggleout" class='chain test out'>toggleout<div>toggleout</div></div>
+ <div id="togglein" class='chain test'>togglein<div>togglein</div></div>
+ <div id="toggleout" class='chain test out'>toggleout<div>toggleout</div></div>
- <div id="slideup" class='chain test'>slideUp<div>slideUp</div></div>
- <div id="slidedown" class='chain test out'>slideDown<div>slideDown</div></div>
+ <div id="slideup" class='chain test'>slideUp<div>slideUp</div></div>
+ <div id="slidedown" class='chain test out'>slideDown<div>slideDown</div></div>
- <div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div>
- <div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div>
+ <div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div>
+ <div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div>
- <div id="fadetogglein" class='chain test'>fadeToggleIn<div>fadeToggleIn</div></div>
- <div id="fadetoggleout" class='chain test out'>fadeToggleOut<div>fadeToggleOut</div></div>
+ <div id="fadetogglein" class='chain test'>fadeToggleIn<div>fadeToggleIn</div></div>
+ <div id="fadetoggleout" class='chain test out'>fadeToggleOut<div>fadeToggleOut</div></div>
- <div id="fadeto" class='chain test'>fadeTo<div>fadeTo</div></div>
- </div>
+ <div id="fadeto" class='chain test'>fadeTo<div>fadeTo</div></div>
+ </div>
- <div id="fx-tests"></div>
+ <div id="fx-tests"></div>
+ </div>
</div>
+ </dl>
<map name="imgmap" id="imgmap">
<area shape="rect" coords="0,0,200,50">
</map>