X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=25cb69b307a378c287cfc226433865639bd749b3;hb=6850c4b29017bcb31e16f0d6c94110a8b8a82304;hp=1410ece7c34a8143c818550528dd837c828b7dcd;hpb=ecaa4d4570b05610d542b971fc4278de3c251e79;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 1410ece..25cb69b 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -74,7 +74,7 @@ test("index(Object)", function() { }); test("attr(String)", function() { - expect(14); + expect(15); ok( $('#text1').attr('value') == "Test", 'Check for value attribute' ); ok( $('#text1').attr('type') == "text", 'Check for type attribute' ); ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' ); @@ -87,7 +87,10 @@ test("attr(String)", function() { ok( $('#name').attr('name') == "name", 'Check for name attribute' ); ok( $('#text1').attr('name') == "action", 'Check for name attribute' ); ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' ); - //equals( "#2", $('#anchor2').attr('href'), 'Check for non-absolute href (an anchor)' ); This fails in IE because the _config.fixture is reloaded using innerHTML + + $('').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path + ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' ); + stop(); $.get("data/dashboard.xml", function(xml) { ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" ); @@ -242,7 +245,7 @@ test("append(String|Element|Array<Element>|jQuery)", function() { reset(); $("#sap").append(document.getElementById('form')); - ok( $("#sap>form").size() == 1, "Check for appending a form" ); + ok( $("#sap>form").size() == 1, "Check for appending a form" ); // Bug #910 }); @@ -426,7 +429,7 @@ test("clone()", function() { }); test("is(String)", function() { - expect(22); + expect(26); ok( $('#form').is('form'), 'Check for element: A form must be a form' ); ok( !$('#form').is('div'), 'Check for element: A form is not a div' ); ok( $('#mark').is('.blog'), 'Check for class: Expected class "blog"' ); @@ -449,6 +452,12 @@ test("is(String)", function() { ok( !$('#foo').is(null), 'Expected false for an invalid expression - null' ); ok( !$('#foo').is(''), 'Expected false for an invalid expression - ""' ); ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' ); + + // test is() with comma-seperated expressions + ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Check for lang attribute: Expecte en or de' ); + ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Check for lang attribute: Expecte en or de' ); + ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Check for lang attribute: Expecte en or de' ); + ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Check for lang attribute: Expecte en or de' ); }); test("$.extend(Object, Object)", function() {