X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjquery%2FcoreTest.js;h=25cb69b307a378c287cfc226433865639bd749b3;hb=b2c2ab2bb7fc43e680214a3627181a0c2226c6f9;hp=11cb5fb1961bfca5903cfca8b2a765dfed9dafa1;hpb=a69aad2242a5be4ee21955d6132247b4781d410e;p=jquery.git
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index 11cb5fb..25cb69b 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -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)' );
+
+ $('').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" );
@@ -210,7 +213,7 @@ test("wrap(String|Element)", function() {
});
test("append(String|Element|Array<Element>|jQuery)", function() {
- expect(9);
+ expect(10);
var defaultText = 'Try them out:'
var result = $('#first').append('buga');
ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@@ -239,6 +242,11 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
ok( $("#sap").append([]), "Check for appending an empty array." );
ok( $("#sap").append(""), "Check for appending an empty string." );
ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." );
+
+ reset();
+ $("#sap").append(document.getElementById('form'));
+ ok( $("#sap>form").size() == 1, "Check for appending a form" ); // Bug #910
+
});
test("appendTo(String|Element|Array<Element>|jQuery)", function() {
@@ -421,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"' );
@@ -444,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() {