aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/attributes.js
diff options
context:
space:
mode:
authorcjqed <christopherjonesqed@gmail.com>2013-12-11 11:34:05 -0500
committerDave Methvin <dave.methvin@gmail.com>2013-12-23 17:21:22 -0500
commit537e9ced6164074c32df429bb1fa4c30361aa711 (patch)
tree6b051e88b52f93e2cd312de42bc7acfd6f802e1d /test/unit/attributes.js
parent23db99440497fccbe9db8853a530d3d30d9320e4 (diff)
downloadjquery-537e9ced6164074c32df429bb1fa4c30361aa711.tar.gz
jquery-537e9ced6164074c32df429bb1fa4c30361aa711.zip
Tests: Avoid use of QUnit.reset() in tests by splitting them
Fix #14040 Close gh-1457
Diffstat (limited to 'test/unit/attributes.js')
-rw-r--r--test/unit/attributes.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 34040939f..548c6f318 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -635,7 +635,8 @@ 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" );
@@ -663,7 +664,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,
@@ -795,16 +800,20 @@ test( "removeProp(String)", function() {
});
});
-test( "val()", function() {
- expect( 21 + ( jQuery.fn.serialize ? 6 : 0 ) );
+test( "val() after modification", function() {
- var checks, $button;
+ 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" );
@@ -919,7 +928,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" );
@@ -974,7 +982,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 ) {