Bug Tracker

Changeset 5684 for trunk/jquery/test

Show
Ignore:
Timestamp:
05/24/08 18:11:55 (8 months ago)
Author:
aflesler
Message:

test runner: adding more tests for attr(). Related to [5574] and [5683].

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/test/unit/core.js

    <
    r5602 r5684  
    1414test("$()", function() { 
    1515    expect(8); 
    16      
     16 
    1717    var main = $("#main"); 
    1818    isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" ); 
    19      
     19 
    2020/* 
    2121    // disabled since this test was doing nothing. i tried to fix it but i'm not sure 
     
    2626    equals( x, what???, "Check for \\r and \\n in jQuery()" ); 
    2727*/ 
    28      
     28 
    2929    /* // Disabled until we add this functionality in 
    3030    var pass = true; 
     
    4242    var div = $("<div/><hr/><code/><b/>"); 
    4343    equals( div.length, 4, "Correct number of elements generated for div hr code b" ); 
    44      
     44 
    4545    // can actually yield more than one, when iframes are included, the window is an array as well 
    4646    equals( $(window).length, 1, "Correct number of elements generated for window" ); 
    47      
     47 
    4848    equals( $(document).length, 1, "Correct number of elements generated for document" ); 
    49      
     49 
    5050    equals( $([1,2,3]).get(1), 2, "Test passing an array to the factory" ); 
    51      
     51 
    5252    equals( $(document.body).get(0), $('body').get(0), "Test passing an html node to the factory" ); 
    5353}); 
     
    9191test("noConflict", function() { 
    9292    expect(6); 
    93      
     93 
    9494    var old = jQuery; 
    9595    var newjQuery = jQuery.noConflict(); 
     
    157157 
    158158    var first = document.body.firstChild; 
    159      
     159 
    160160    // Normal elements are reported ok everywhere 
    161161    ok( !jQuery.isFunction(first), "A normal DOM Element" ); 
     
    207207    $("body").append(s); 
    208208    ok( foo, "Executing a scripts contents in the right context" ); 
    209      
     209 
    210210    reset(); 
    211211    ok( $("<link rel='stylesheet'/>")[0], "Creating a link" ); 
    212      
     212 
    213213    reset(); 
    214214 
     
    231231    expect(2); 
    232232    stop(); 
    233     $.get('data/dashboard.xml', function(xml) {  
     233    $.get('data/dashboard.xml', function(xml) { 
    234234        // tests for #1419 where IE was a problem 
    235235        equals( $("tab:first", xml).text(), "blabla", "Verify initial text correct" ); 
     
    270270    // use $([]).add(form.elements) instead. 
    271271    //equals( $([]).add($("#form")[0].elements).length, $($("#form")[0].elements).length, "Array in constructor must equals array in add()" ); 
    272      
     272 
    273273    var x = $([]).add($("<p id='x1'>xxx</p>")).add($("<p id='x2'>xxx</p>")); 
    274274    equals( x[0].id, "x1", "Check on-the-fly element1" ); 
    275275    equals( x[1].id, "x2", "Check on-the-fly element2" ); 
    276      
     276 
    277277    var x = $([]).add("<p id='x1'>xxx</p>").add("<p id='x2'>xxx</p>"); 
    278278    equals( x[0].id, "x1", "Check on-the-fly element1" ); 
    279279    equals( x[1].id, "x2", "Check on-the-fly element2" ); 
    280      
     280 
    281281    var notDefined; 
    282282    equals( $([]).add(notDefined).length, 0, "Check that undefined adds nothing" ); 
    283      
     283 
    284284    // Added after #2811 
    285285    equals( $([]).add([window,document,document.body,document]).length, 3, "Pass an array" ); 
     
    302302test("index(Object)", function() { 
    303303    expect(10); 
    304      
     304 
    305305    var elements = $([window, document]), 
    306306        inputElements = $('#radio1,#radio2,#check1,#check2'); 
    307      
     307 
    308308    equals( elements.index(window), 0, "Check for index of elements" ); 
    309309    equals( elements.index(document), 1, "Check for index of elements" ); 
     
    314314    equals( inputElements.index(window), -1, "Check for not found index" ); 
    315315    equals( inputElements.index(document), -1, "Check for not found index" ); 
    316      
     316 
    317317    // enabled since [5500] 
    318318    equals( elements.index( elements ), 0, "Pass in a jQuery object" ); 
     
    321321 
    322322test("attr(String)", function() { 
    323     expect(20); 
     323    expect(26); 
    324324    equals( $('#text1').attr('value'), "Test", 'Check for value attribute' ); 
    325325    equals( $('#text1').attr('value', "Test2").attr('defaultValue'), "Test", 'Check for defaultValue attribute' ); 
     
    341341    equals( $('#foo').attr('nodeName'), 'DIV', 'Check for nodeName attribute' ); 
    342342    equals( $('#foo').attr('tagName'), 'DIV', 'Check for tagName attribute' ); 
    343      
     343 
    344344    $('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path 
    345345    equals( $('#tAnchor5').attr('href'), "#5", 'Check for non-absolute href (an anchor)' ); 
     346 
     347 
     348    // Related to [5574] and [5683] 
     349    var body = document.body, $body = $(body); 
     350 
     351    ok( $body.attr('foo') === undefined, 'Make sure that a non existent attribute returns undefined' ); 
     352    ok( $body.attr('nextSibling') === null, 'Make sure a null expando returns null' ); 
     353     
     354    body.setAttribute('foo', 'baz'); 
     355    equals( $body.attr('foo'), 'baz', 'Make sure the dom attribute is retrieved when no expando is found' ); 
     356     
     357    body.foo = 'bar'; 
     358    equals( $body.attr('foo'), 'bar', 'Make sure the expando is preferred over the dom attribute' ); 
     359     
     360    $body.attr('foo','cool'); 
     361    equals( $body.attr('foo'), 'cool', 'Make sure that setting works well when both expando and dom attribute are available' ); 
     362     
     363    body.foo = undefined; 
     364    ok( $body.attr('foo') === undefined, 'Make sure the expando is preferred over the dom attribute, even if undefined' ); 
     365     
     366    body.removeAttribute('foo'); // Cleanup 
    346367}); 
    347368 
     
    385406    equals( fail, false, "Set Attribute, the #"+fail+" element didn't get the attribute 'foo'" ); 
    386407 
    387     ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );     
    388      
     408    ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" ); 
     409 
    389410    $("#name").attr('name', 'something'); 
    390411    equals( $("#name").attr('name'), 'something', 'Set name attribute' ); 
     
    444465        expect(2); 
    445466        stop(); 
    446         $.get('data/dashboard.xml', function(xml) {  
     467        $.get('data/dashboard.xml', function(xml) { 
    447468            var titles = []; 
    448469            $('tab', xml).each(function() { 
     
    458479test("css(String|Hash)", function() { 
    459480    expect(19); 
    460      
     481 
    461482    equals( $('#main').css("display"), 'none', 'Check for css property "display"'); 
    462      
     483 
    463484    ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible'); 
    464485    $('#foo').css({display: 'none'}); 
     
    466487    $('#foo').css({display: 'block'}); 
    467488    ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible'); 
    468      
     489 
    469490    $('#floatTest').css({styleFloat: 'right'}); 
    470491    equals( $('#floatTest').css('styleFloat'), 'right', 'Modified CSS float using "styleFloat": Assert float is right'); 
     
    475496    $('#floatTest').css({'font-size': '30px'}); 
    476497    equals( $('#floatTest').css('font-size'), '30px', 'Modified CSS font-size: Assert font-size is 30px'); 
    477      
     498 
    478499    $.each("0,0.25,0.5,0.75,1".split(','), function(i, n) { 
    479500        $('#foo').css({opacity: n}); 
     
    481502        $('#foo').css({opacity: parseFloat(n)}); 
    482503        equals( $('#foo').css('opacity'), parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a Number" ); 
    483     });  
     504    }); 
    484505    $('#foo').css({opacity: ''}); 
    485506    equals( $('#foo').css('opacity'), '1', "Assert opacity is 1 when set to an empty String" ); 
     
    493514    $('#foo').css('display', 'block'); 
    494515    ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible'); 
    495      
     516 
    496517    $('#floatTest').css('styleFloat', 'left'); 
    497518    equals( $('#floatTest').css('styleFloat'), 'left', 'Modified CSS float using "styleFloat": Assert float is left'); 
     
    502523    $('#floatTest').css('font-size', '20px'); 
    503524    equals( $('#floatTest').css('font-size'), '20px', 'Modified CSS font-size: Assert font-size is 20px'); 
    504      
     525 
    505526    $.each("0,0.25,0.5,0.75,1".split(','), function(i, n) { 
    506527        $('#foo').css('opacity', n); 
     
    559580    $div.hide(); 
    560581    equals($div.width(), 30, "Test hidden div"); 
    561      
     582 
    562583    $div.css({ display: "", border: "", padding: "" }); 
    563      
     584 
    564585    $("#nothiddendivchild").css({ padding: "3px", border: "2px solid #fff" }); 
    565586    equals($("#nothiddendivchild").width(), 20, "Test child width with border and padding"); 
     
    587608    $div.hide(); 
    588609    equals($div.height(), 30, "Test hidden div"); 
    589      
     610 
    590611    $div.css({ display: "", border: "", padding: "", height: "1px" }); 
    591612}); 
     
    609630    ok( result.is('ol'), 'Check for element wrapping' ); 
    610631    equals( result.text(), defaultText, 'Check for element wrapping' ); 
    611      
    612     reset(); 
    613     $('#check1').click(function() {      
    614         var checkbox = this;         
     632 
     633    reset(); 
     634    $('#check1').click(function() { 
     635        var checkbox = this; 
    615636        ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" ); 
    616637        $(checkbox).wrap( '<div id="c1" style="display:none;"></div>' ); 
     
    667688    equals( result.text(), defaultText + 'buga', 'Check if text appending works' ); 
    668689    equals( $('#select3').append('<option value="appendTest">Append Test</option>').find('option:last-child').attr('value'), 'appendTest', 'Appending html options to select element'); 
    669      
     690 
    670691    reset(); 
    671692    var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:"; 
    672693    $('#sap').append(document.getElementById('first')); 
    673694    equals( expected, $('#sap').text(), "Check for appending of element" ); 
    674      
     695 
    675696    reset(); 
    676697    expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; 
    677698    $('#sap').append([document.getElementById('first'), document.getElementById('yahoo')]); 
    678699    equals( expected, $('#sap').text(), "Check for appending of array of elements" ); 
    679      
     700 
    680701    reset(); 
    681702    expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; 
     
    695716    ok( $("#sap").append(""), "Check for appending an empty string." ); 
    696717    ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." ); 
    697      
     718 
    698719    reset(); 
    699720    $("#sap").append(document.getElementById('form')); 
     
    709730 
    710731    ok( pass, "Test for appending a DOM node to the contents of an IFrame" ); 
    711      
     732 
    712733    reset(); 
    713734    $('<fieldset/>').appendTo('#form').append('<legend id="legend">test</legend>'); 
    714735    t( 'Append legend', '#legend', ['legend'] ); 
    715      
     736 
    716737    reset(); 
    717738    $('#select1').append('<OPTION>Test</OPTION>'); 
    718739    equals( $('#select1 option:last').text(), "Test", "Appending &lt;OPTION&gt; (all caps)" ); 
    719      
     740 
    720741    $('#table').append('<colgroup></colgroup>'); 
    721742    ok( $('#table colgroup').length, "Append colgroup" ); 
    722      
     743 
    723744    $('#table colgroup').append('<col/>'); 
    724745    ok( $('#table colgroup col').length, "Append col" ); 
    725      
     746 
    726747    reset(); 
    727748    $('#table').append('<caption></caption>'); 
     
    732753        .append('<select id="appendSelect1"></select>') 
    733754        .append('<select id="appendSelect2"><option>Test</option></select>'); 
    734      
     755 
    735756    t( "Append Select", "#appendSelect1, #appendSelect2", ["appendSelect1", "appendSelect2"] ); 
    736757 
     
    751772    equals( $("#first").text(), defaultText + 'buga', 'Check if text appending works' ); 
    752773    equals( $('<option value="appendTest">Append Test</option>').appendTo('#select3').parent().find('option:last-child').attr('value'), 'appendTest', 'Appending html options to select element'); 
    753      
     774 
    754775    reset(); 
    755776    var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:"; 
    756777    $(document.getElementById('first')).appendTo('#sap'); 
    757778    equals( expected, $('#sap').text(), "Check for appending of element" ); 
    758      
     779 
    759780    reset(); 
    760781    expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; 
    761782    $([document.getElementById('first'), document.getElementById('yahoo')]).appendTo('#sap'); 
    762783    equals( expected, $('#sap').text(), "Check for appending of array of elements" ); 
    763      
     784 
    764785    reset(); 
    765786    expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; 
    766787    $("#first, #yahoo").appendTo('#sap'); 
    767788    equals( expected, $('#sap').text(), "Check for appending of jQuery object" ); 
    768      
     789 
    769790    reset(); 
    770791    $('#select1').appendTo('#foo'); 
     
    778799    equals( result.text(), 'buga' + defaultText, 'Check if text prepending works' ); 
    779800    equals( $('#select3').prepend('<option value="prependTest">Prepend Test</option>').find('option:first-child').attr('value'), 'prependTest', 'Prepending html options to select element'); 
    780      
     801 
    781802    reset(); 
    782803    var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog"; 
     
    788809    $('#sap').prepend([document.getElementById('first'), document.getElementById('yahoo')]); 
    789810    equals( expected, $('#sap').text(), "Check for prepending of array of elements" ); 
    790      
     811 
    791812    reset(); 
    792813    expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog"; 
     
    801822    equals( $('#first').text(), 'buga' + defaultText, 'Check if text prepending works' ); 
    802823    equals( $('<option value="prependTest">Prepend Test</option>').prependTo('#select3').parent().find('option:first-child').attr('value'), 'prependTest', 'Prepending html options to select element'); 
    803      
     824 
    804825    reset(); 
    805826    var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog"; 
     
    811832    $([document.getElementById('yahoo'), document.getElementById('first')]).prependTo('#sap'); 
    812833    equals( expected, $('#sap').text(), "Check for prepending of array of elements" ); 
    813      
     834 
    814835    reset(); 
    815836    expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog"; 
    816837    $("#yahoo, #first").prependTo('#sap'); 
    817838    equals( expected, $('#sap').text(), "Check for prepending of jQuery object" ); 
    818      
     839 
    819840    reset(); 
    820841    $('<select id="prependSelect1"></select>').prependTo('form:last'); 
    821842    $('<select id="prependSelect2"><option>Test</option></select>').prependTo('form:last'); 
    822      
     843 
    823844    t( "Prepend Select", "#prependSelect1, #prependSelect2", ["prependSelect1", "prependSelect2"] ); 
    824845}); 
     
    829850    $('#yahoo').before('<b>buga</b>'); 
    830851    equals( expected, $('#en').text(), 'Insert String before' ); 
    831      
     852 
    832853    reset(); 
    833854    expected = "This is a normal link: Try them out:Yahoo"; 
    834855    $('#yahoo').before(document.getElementById('first')); 
    835856    equals( expected, $('#en').text(), "Insert element before" ); 
    836      
     857 
    837858    reset(); 
    838859    expected = "This is a normal link: Try them out:diveintomarkYahoo"; 
    839860    $('#yahoo').before([document.getElementById('first'), document.getElementById('mark')]); 
    840861    equals( expected, $('#en').text(), "Insert array of elements before" ); 
    841      
     862 
    842863    reset(); 
    843864    expected = "This is a normal link: Try them out:diveintomarkYahoo"; 
     
    851872    $('<b>buga</b>').insertBefore('#yahoo'); 
    852873    equals( expected, $('#en').text(), 'Insert String before' ); 
    853      
     874 
    854875    reset(); 
    855876    expected = "This is a normal link: Try them out:Yahoo"; 
    856877    $(document.getElementById('first')).insertBefore('#yahoo'); 
    857878    equals( expected, $('#en').text(), "Insert element before" ); 
    858      
     879 
    859880    reset(); 
    860881    expected = "This is a normal link: Try them out:diveintomarkYahoo"; 
    861882    $([document.getElementById('first'), document.getElementById('mark')]).insertBefore('#yahoo'); 
    862883    equals( expected, $('#en').text(), "Insert array of elements before" ); 
    863      
     884 
    864885    reset(); 
    865886    expected = "This is a normal link: Try them out:diveintomarkYahoo"; 
     
    873894    $('#yahoo').after('<b>buga</b>'); 
    874895    equals( expected, $('#en').text(), 'Insert String after' ); 
    875      
     896 
    876897    reset(); 
    877898    expected = "This is a normal link: YahooTry them out:"; 
     
    883904    $('#yahoo').after([document.getElementById('first'), document.getElementById('mark')]); 
    884905    equals( expected, $('#en').text(), "Insert array of elements after" ); 
    885      
     906 
    886907    reset(); 
    887908    expected = "This is a normal link: YahooTry them out:diveintomark"; 
     
    895916    $('<b>buga</b>').insertAfter('#yahoo'); 
    896917    equals( expected, $('#en').text(), 'Insert String after' ); 
    897      
     918 
    898919    reset(); 
    899920    expected = "This is a normal link: YahooTry them out:"; 
     
    905926    $([document.getElementById('mark'), document.getElementById('first')]).insertAfter('#yahoo'); 
    906927    equals( expected, $('#en').text(), "Insert array of elements after" ); 
    907      
     928 
    908929    reset(); 
    909930    expected = "This is a normal link: YahooTry them out:diveintomark"; 
     
    917938    ok( $("#replace")[0], 'Replace element with string' ); 
    918939    ok( !$("#yahoo")[0], 'Verify that original element is gone, after string' ); 
    919      
     940 
    920941    reset(); 
    921942    $('#yahoo').replaceWith(document.getElementById('first')); 
     
    928949    ok( $("#mark")[0], 'Replace element with array of elements' ); 
    929950    ok( !$("#yahoo")[0], 'Verify that original element is gone, after array of elements' ); 
    930      
     951 
    931952    reset(); 
    932953    $('#yahoo').replaceWith($("#first, #mark")); 
     
    941962    ok( $("#replace")[0], 'Replace element with string' ); 
    942963    ok( !$("#yahoo")[0], 'Verify that original element is gone, after string' ); 
    943      
     964 
    944965    reset(); 
    945966    $(document.getElementById('first')).replaceAll("#yahoo"); 
     
    952973    ok( $("#mark")[0], 'Replace element with array of elements' ); 
    953974    ok( !$("#yahoo")[0], 'Verify that original element is gone, after array of elements' ); 
    954      
     975 
    955976    reset(); 
    956977    $("#first, #mark").replaceAll("#yahoo"); 
     
    964985    equals( 'Yahoo', $('#yahoo').parent().end().text(), 'Check for end' ); 
    965986    ok( $('#yahoo').end(), 'Check for end with nothing to end' ); 
    966      
     987 
    967988    var x = $('#yahoo'); 
    968989    x.parent(); 
     
    9861007    equals( 'This is a normal link: Yahoo', $('#en').text(), 'Reassert text for #en' ); 
    9871008 
    988     var cloneTags = [  
    989         "<table/>", "<tr/>", "<td/>", "<div/>",  
     1009    var cloneTags = [ 
     1010        "<table/>", "<tr/>", "<td/>", "<div/>", 
    9901011        "<button/>", "<ul/>", "<ol/>", "<li/>", 
    9911012        "<input type='checkbox' />", "<select/>", "<option/>", "<textarea/>", 
     
    10411062    ok( !$('#foo').is(''), 'Expected false for an invalid expression - ""' ); 
    10421063    ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' ); 
    1043      
     1064 
    10441065    // test is() with comma-seperated expressions 
    10451066    ok( $('#en').is('[lang="en"],[lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); 
     
    10741095    isObj( deep2.foo, deep2copy.foo, "Check if not deep2: options must not be modified" ); 
    10751096    equals( deep1.foo2, document, "Make sure that a deep clone was not attempted on the document" ); 
    1076      
     1097 
    10771098    var nullUndef; 
    10781099    nullUndef = jQuery.extend({}, options, { xnumber2: null }); 
    10791100    ok( nullUndef.xnumber2 === null, "Check to make sure null values are copied"); 
    1080      
     1101 
    10811102    nullUndef = jQuery.extend({}, options, { xnumber2: undefined }); 
    10821103    ok( nullUndef.xnumber2 === options.xnumber2, "Check to make sure undefined values are not copied"); 
    1083      
     1104 
    10841105    nullUndef = jQuery.extend({}, options, { xnumber0: null }); 
    10851106    ok( nullUndef.xnumber0 === null, "Check to make sure null values are inserted"); 
    1086      
     1107 
    10871108    var target = {}; 
    10881109    var recursive = { foo:target, bar:5 }; 
     
    11371158    $("#text1").val('test'); 
    11381159    ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" ); 
    1139      
     1160 
    11401161    $("#select1").val("3"); 
    11411162    equals( $("#select1").val(), "3", "Check for modified (via val(String)) value of select element" ); 
     
    11641185    var j = $("#nonnodes").contents(); 
    11651186    j.html("<b>bold</b>"); 
    1166      
     1187 
    11671188    // this is needed, or the expando added by jQuery unique will yield a different html 
    1168     j.find('b').removeData();    
     1189    j.find('b').removeData(); 
    11691190    equals( j.html().toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" ); 
    11701191 
     
    12071228    equals( $("p").not(document.getElementsByTagName("p")).length, 0, "not(Array-like DOM collection)" ); 
    12081229    isSet( $("#form option").not("option.emptyopt:contains('Nothing'),[selected],[value='1']").get(), q("option1c", "option1d", "option2c", "option3d" ), "not('complex selector')"); 
    1209      
     1230 
    12101231    var selects = $("#form select"); 
    12111232    isSet( selects.not( selects[1] ), q("select1", "select3"), "filter out DOM element"); 
     
    12231244    expect(5); 
    12241245    isSet( $("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" ); 
    1225     isSet( $("#sndp").siblings(":has(code)").get(), q("sap"), "Check for filtered siblings (has code child element)" );  
     1246    isSet( $("#sndp").siblings(":has(code)").get(), q("sap"), "Check for filtered siblings (has code child element)" ); 
    12261247    isSet( $("#sndp").siblings(":has(a)").get(), q("en", "sap"), "Check for filtered siblings (has anchor child element)" ); 
    12271248    isSet( $("#foo").siblings("form, b").get(), q("form", "lengthtest", "testForm", "floatTest"), "Check for multiple filters" ); 
     
    12441265    isSet( $("#en, #sndp").parent().get(), q("foo"), "Check for unique results from parent" ); 
    12451266}); 
    1246      
     1267 
    12471268test("parents([String])", function() { 
    12481269    expect(5); 
     
    12611282    equals( $("#ap").next("div, p")[0].id, "foo", "Multiple filters" ); 
    12621283}); 
    1263      
     1284 
    12641285test("prev([String])", function() { 
    12651286    expect(4); 
     
    12771298    }); 
    12781299    ok( pass, "Show" ); 
    1279      
     1300 
    12801301    $("#main").append('<div id="show-tests"><div><p><a href="#"></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>'); 
    12811302    var test = { 
     
    12951316        "li"       : $.browser.msie ? "block" : "list-item" 
    12961317    }; 
    1297      
     1318 
    12981319    $.each(test, function(selector, expected) { 
    12991320        var elem = $(selector, "#show-tests").show(); 
     
    13261347    } 
    13271348    ok( pass, "Remove Class" ); 
    1328      
     1349 
    13291350    reset(); 
    13301351    var div = $("div").addClass("test").addClass("foo").addClass("bar"); 
     
    13351356    } 
    13361357    ok( pass, "Remove multiple classes" ); 
    1337      
     1358 
    13381359    reset(); 
    13391360    var div = $("div:eq(0)").addClass("test").removeClass(""); 
    13401361    ok( div.is('.test'), "Empty string passed to removeClass" );