diff options
author | cjqed <christopherjonesqed@gmail.com> | 2013-12-24 11:35:41 -0500 |
---|---|---|
committer | Oleg <markelog@gmail.com> | 2014-01-03 08:01:46 +0400 |
commit | 305eefe6abadbac021a84d031cb4649022657ac7 (patch) | |
tree | fc56314e6e1b888d87425171a46b4ebc3763ba7f /test/unit/attributes.js | |
parent | 3140d3bdd3a520e98c5178b04eba68ce16dacf46 (diff) | |
download | jquery-305eefe6abadbac021a84d031cb4649022657ac7.tar.gz jquery-305eefe6abadbac021a84d031cb4649022657ac7.zip |
Tests: Avoid use of QUnit.reset() in tests by splitting them
Closes gh-1470
Ref #1457
Diffstat (limited to 'test/unit/attributes.js')
-rw-r--r-- | test/unit/attributes.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 4f08e0e40..8ba2b4459 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -639,7 +639,7 @@ test( "removeAttr(Multi String, variable space width)", function() { }); test( "prop(String, Object)", function() { - expect( 31 ); + expect( 17 ); equal( jQuery("#text1").prop("value"), "Test", "Check for value attribute" ); equal( jQuery("#text1").prop( "value", "Test2" ).prop("defaultValue"), "Test", "Check for defaultValue attribute" ); @@ -667,7 +667,11 @@ test( "prop(String, Object)", function() { equal( jQuery("#table").prop("useMap"), 1, "Check setting and retrieving useMap" ); jQuery("#table").prop( "frameborder", 1 ); equal( jQuery("#table").prop("frameBorder"), 1, "Check setting and retrieving frameBorder" ); - QUnit.reset(); +}); + +test( "prop(String, Object) on null/undefined", function() { + + expect( 14 ); var select, optgroup, option, attributeNode, commentNode, textNode, obj, $form, body = document.body, @@ -799,16 +803,19 @@ test( "removeProp(String)", function() { }); }); -test( "val()", function() { - expect( 21 + ( jQuery.fn.serialize ? 6 : 0 ) ); - - var checks, $button; +test( "val() after modification", function() { + expect( 1 ); document.getElementById("text1").value = "bla"; equal( jQuery("#text1").val(), "bla", "Check for modified value of input element" ); - QUnit.reset(); +}); +test( "val()", function() { + + expect( 20 + ( jQuery.fn.serialize ? 6 : 0 ) ); + + var checks, $button; equal( jQuery("#text1").val(), "Test", "Check for value of input element" ); // ticket #1714 this caused a JS error in IE equal( jQuery("#first").val(), "", "Check a paragraph element to see if it has a value" ); @@ -923,7 +930,6 @@ if ( "value" in document.createElement("meter") && var testVal = function( valueObj ) { expect( 8 ); - QUnit.reset(); jQuery("#text1").val( valueObj("test") ); equal( document.getElementById("text1").value, "test", "Check for modified (via val(String)) value of input element" ); @@ -978,7 +984,6 @@ test( "val(Array of Numbers) (Bug #7123)", function() { test( "val(Function) with incoming value", function() { expect( 10 ); - QUnit.reset(); var oldVal = jQuery("#text1").val(); jQuery("#text1").val(function( i, val ) { |