Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Tweak :submit/:reset tests to work against injected HTML.

  • Loading branch information...
commit 3ba396e439a07c2a2facafbe07cdaa1b80a24c00 1 parent 4817214
John Resig jeresig authored

Showing 1 changed file with 4 additions and 11 deletions. Show diff stats Hide diff stats

  1. +4 11 test/unit/selector.js
15 test/unit/selector.js
@@ -425,20 +425,13 @@ test("pseudo - misc", function() {
425 425 document.body.appendChild( tmp );
426 426
427 427 jQuery.each( [ "button", "submit", "reset" ], function( i, type ) {
428   - var input = document.createElement( "input" );
429   - input.id = "input_" + type;
430   - input.setAttribute( "type", type );
431   - tmp.appendChild( input );
432   -
433   - var button = document.createElement( "button" );
434   - button.id = "button_" + type;
435   - button.setAttribute( "type", type );
436   - tmp.appendChild( button );
  428 + jQuery( tmp ).append(
  429 + "<input id='input_T' type='T'/><button id='button_T' type='T'>test</button>".replace(/T/g, type) );
437 430
438 431 t( "Input Buttons :" + type, "#tmp_input :" + type, [ "input_" + type, "button_" + type ] );
439 432
440   - ok( (window.Sizzle || window.jQuery.find).matchesSelector( input, ":" + type ), "Input Matches :" + type );
441   - ok( (window.Sizzle || window.jQuery.find).matchesSelector( button, ":" + type ), "Button Matches :" + type );
  433 + ok( (window.Sizzle || window.jQuery.find).matchesSelector( jQuery("#input_" + type)[0], ":" + type ), "Input Matches :" + type );
  434 + ok( (window.Sizzle || window.jQuery.find).matchesSelector( jQuery("#button_" + type)[0], ":" + type ), "Button Matches :" + type );
442 435 });
443 436
444 437

0 comments on commit 3ba396e

Please sign in to comment.
Something went wrong with that request. Please try again.