diff options
author | Alexander Lisianoi <all3fox@gmail.com> | 2016-02-15 00:18:21 +0300 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2016-02-22 11:56:04 -0500 |
commit | ddb2c06f51a20d1da2d444ecda88f9ed64ef2e91 (patch) | |
tree | a450ad49216ac6150a42e4a11c505e1f5322d0f4 /test | |
parent | 12038c7234ed808b2116a9f03c448c139d5fb9ae (diff) | |
download | jquery-ddb2c06f51a20d1da2d444ecda88f9ed64ef2e91.tar.gz jquery-ddb2c06f51a20d1da2d444ecda88f9ed64ef2e91.zip |
Tests: limit selection to #qunit-fixture in attributes.js
Ref gh-2880
Close gh-2921
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/attributes.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 6ba64060e..23c13a7cd 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -220,7 +220,8 @@ QUnit.test( "attr(String, Function)", function( assert ) { QUnit.test( "attr(Hash)", function( assert ) { assert.expect( 3 ); var pass = true; - jQuery( "div" ).attr( { + + jQuery( "#qunit-fixture div" ).attr( { "foo": "baz", "zoo": "ping" } ).each( function() { @@ -258,7 +259,7 @@ QUnit.test( "attr(String, Object)", function( assert ) { attributeNode, commentNode, textNode, obj, table, td, j, type, check, thrown, button, $radio, $radios, $svg, - div = jQuery( "div" ).attr( "foo", "bar" ), + div = jQuery( "#qunit-fixture div" ).attr( "foo", "bar" ), i = 0, fail = false; @@ -491,9 +492,9 @@ QUnit.test( "attr - extending the boolean attrHandle", function( assert ) { called = true; _handle.apply( this, arguments ); }; - jQuery( "input" ).attr( "checked" ); + jQuery( "#qunit-fixture input" ).attr( "checked" ); called = false; - jQuery( "input" ).attr( "checked" ); + jQuery( "#qunit-fixture input" ).attr( "checked" ); assert.ok( called, "The boolean attrHandle does not drop custom attrHandles" ); } ); @@ -1027,7 +1028,7 @@ QUnit.test( "val(Function)", function( assert ) { QUnit.test( "val(Array of Numbers) (Bug #7123)", function( assert ) { assert.expect( 4 ); jQuery( "#form" ).append( "<input type='checkbox' name='arrayTest' value='1' /><input type='checkbox' name='arrayTest' value='2' /><input type='checkbox' name='arrayTest' value='3' checked='checked' /><input type='checkbox' name='arrayTest' value='4' />" ); - var elements = jQuery( "input[name=arrayTest]" ).val( [ 1, 2 ] ); + var elements = jQuery( "#form input[name=arrayTest]" ).val( [ 1, 2 ] ); assert.ok( elements[ 0 ].checked, "First element was checked" ); assert.ok( elements[ 1 ].checked, "Second element was checked" ); assert.ok( !elements[ 2 ].checked, "Third element was unchecked" ); |