Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test: Update index.html to new QUnit format. Close jquerygh-177.
This is needed for jquery/jquery#1061.

Aside from the usual clusterfuck of inter tangled dependencies
between the different fixtures (primarily related to the stuff
outside #qunit-fixture), this also stabilises the situation a bit
in general. So in the future they should be a lot less dependent
on each other.
  • Loading branch information
Krinkle authored and dmethvin committed Dec 11, 2012
1 parent c3787e7 commit b82ec2a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
20 changes: 10 additions & 10 deletions test/index.html
Expand Up @@ -13,16 +13,9 @@
</head>

<body id="body">
<h1 id="qunit-header">Sizzle Test Suite</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit"></div>

<!-- Test HTML -->
<div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
<div id="nothiddendivchild"></div>
</div>
<dl id="dl" style="position:absolute;top:-32767px;left:-32767px;width:1px">
<div id="qunit-fixture">
<p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
Expand All @@ -39,6 +32,9 @@ <h2 id="qunit-userAgent"></h2>
<p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>

</div>
<div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
<div id="nothiddendivchild"></div>
</div>
<span id="name+value"></span>
<p id="first">Try them out:</p>
<ul id="firstUL"></ul>
Expand Down Expand Up @@ -191,6 +187,10 @@ <h2 id="qunit-userAgent"></h2>
<input type="hidden" id="el12087" data-comma="0,1"/>
</div>
<div id="no-clone-exception"><object><embed></embed></object></div>
<div id="names-group">
<span id="name-is-example" name="example"></span>
<span id="name-is-div" name="div"></span>
</div>
</div>

<div id="tabindex-tests">
Expand Down Expand Up @@ -230,8 +230,8 @@ <h2 id="qunit-userAgent"></h2>
</div>
</dl>
<div id="fx-test-group" style="position:absolute;width:1px;height:1px;overflow:hidden;">
<div id="fx-queue" name="test">
<div id="fadein" class='chain test' name='div'>fadeIn<div>fadeIn</div></div>
<div id="fx-queue">
<div id="fadein" class='chain test'>fadeIn<div>fadeIn</div></div>
<div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>

<div id="show" class='chain test'>show<div>show</div></div>
Expand Down
32 changes: 16 additions & 16 deletions test/unit/selector.js
Expand Up @@ -101,8 +101,8 @@ test("element", function() {
t( "Trailing line feed", "#qunit-fixture p\n", ["firstp","ap","sndp","en","sap","first"] );
t( "Trailing form feed", "#qunit-fixture p\f", ["firstp","ap","sndp","en","sap","first"] );

t( "Parent Element", "div p", ["firstp","ap","sndp","en","sap","first"] );
t( "Parent Element (non-space descendant combinator)", "div\tp", ["firstp","ap","sndp","en","sap","first"] );
t( "Parent Element", "#qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
t( "Parent Element (non-space descendant combinator)", "#qunit-fixture\tp", ["firstp","ap","sndp","en","sap","first"] );
var obj1 = document.getElementById("object1");
equal( Sizzle("param", obj1).length, 2, "Object/param as context" );

Expand Down Expand Up @@ -268,7 +268,7 @@ test("id", function() {
deepEqual( Sizzle("div#form", document.body), [], "ID selector within the context of another element" );

t( "Underscore ID", "#types_all", ["types_all"] );
t( "Dash ID", "#fx-queue", ["fx-queue"] );
t( "Dash ID", "#qunit-fixture", ["qunit-fixture"] );

t( "ID with weird characters in it", "#name\\+value", ["name+value"] );
});
Expand Down Expand Up @@ -323,8 +323,8 @@ test("name", function() {
t( "Name selector with single quotes", "input[name='action']", ["text1"] );
t( "Name selector with double quotes", 'input[name="action"]', ["text1"] );

t( "Name selector non-input", "[name=test]", ["length", "fx-queue"] );
t( "Name selector non-input", "[name=div]", ["fadein"] );
t( "Name selector non-input", "[name=example]", ["name-is-example"] );
t( "Name selector non-input", "[name=div]", ["name-is-div"] );
t( "Name selector non-input", "*[name=iframe]", ["iframe"] );

t( "Name selector for grouped input", "input[name='types[]']", ["types_all", "types_anime", "types_movie"] );
Expand Down Expand Up @@ -381,7 +381,7 @@ test("child and adjacent", function() {
t( "Adjacent", "p[lang=en] + p", ["sap"] );
t( "Adjacent", "a.GROUPS + code + a", ["mark"] );
t( "Comma, Child, and Adjacent", "#qunit-fixture a + a, code > a", ["groups","anchor1","anchor2"] );
t( "Element Preceded By", "#qunit-fixture p ~ div", ["foo", "moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
t( "Element Preceded By", "#qunit-fixture p ~ div", ["foo", "nothiddendiv", "moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
t( "Element Preceded By", "#first ~ div", ["moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
t( "Element Preceded By", "#groups ~ a", ["mark"] );
t( "Element Preceded By", "#length ~ input", ["idTest"] );
Expand Down Expand Up @@ -652,7 +652,7 @@ test("pseudo - nth-of-type", function() {
t( "Nth-of-type(even)", "#ap :nth-of-type(even)", ["groups"] );
t( "Nth-of-type(2n+1)", "#ap :nth-of-type(2n+1)", ["google", "code1", "anchor1", "mark"] );
t( "Nth-of-type(odd)", "#ap :nth-of-type(odd)", ["google", "code1", "anchor1", "mark"] );
t( "Nth-of-type(-n+2)", "#qunit-fixture > :nth-of-type(-n+2)", ["firstp", "ap", "foo", "name+value", "firstUL", "empty", "form", "floatTest", "iframe", "lengthtest", "table", "moretests"] );
t( "Nth-of-type(-n+2)", "#qunit-fixture > :nth-of-type(-n+2)", ["firstp", "ap", "foo", "nothiddendiv", "name+value", "firstUL", "empty", "form", "floatTest", "iframe", "lengthtest", "table"] );
});

test("pseudo - nth-last-of-type", function() {
Expand Down Expand Up @@ -845,7 +845,7 @@ test("pseudo - :not", function() {
t( ":not() Multiple Class", "#foo a:not(.link)", ["yahoo", "anchor2"] );
t( ":not() Multiple Class", "#foo a:not(.blog.link)", ["yahoo", "anchor2"] );

t( ":not chaining (compound)", "#qunit-fixture div[id]:not(:has(div, span)):not(:has(*))", ["divWithNoTabIndex"] );
t( ":not chaining (compound)", "#qunit-fixture div[id]:not(:has(div, span)):not(:has(*))", ["nothiddendivchild", "divWithNoTabIndex"] );
t( ":not chaining (with attribute)", "#qunit-fixture form[id]:not([action$='formaction']):not(:button)", ["lengthtest", "name-tests", "testForm"] );
t( ":not chaining (colon in attribute)", "#qunit-fixture form[id]:not([action='form:action']):not(:button)", ["form", "lengthtest", "name-tests", "testForm"] );
t( ":not chaining (colon in attribute and nested chaining)", "#qunit-fixture form[id]:not([action='form:action']:button):not(:input)", ["form", "lengthtest", "name-tests", "testForm"] );
Expand All @@ -867,8 +867,8 @@ test("pseudo - :not", function() {
test("pseudo - position", function() {
expect( 34 );

t( "First element", "div:first", ["qunit-testrunner-toolbar"] );
t( "First element(case-insensitive)", "div:fiRst", ["qunit-testrunner-toolbar"] );
t( "First element", "div:first", ["qunit"] );
t( "First element(case-insensitive)", "div:fiRst", ["qunit"] );
t( "nth Element", "#qunit-fixture p:nth(1)", ["ap"] );
t( "First Element", "#qunit-fixture p:first", ["firstp"] );
t( "Last Element", "p:last", ["first"] );
Expand All @@ -889,11 +889,11 @@ test("pseudo - position", function() {
t( "Check position filtering", "div.nothiddendiv:last", ["nothiddendiv"] );
t( "Check position filtering", "div.nothiddendiv:not(:lt(0))", ["nothiddendiv"] );

t( "Check element position", "div div:eq(0)", ["nothiddendivchild"] );
t( "Check element position", "div div:eq(5)", ["t2037"] );
t( "Check element position", "div div:eq(29)", ["slideup"] );
t( "Check element position", "div div:first", ["nothiddendivchild"] );
t( "Check element position", "div > div:first", ["nothiddendivchild"] );
t( "Check element position", "#qunit-fixture div div:eq(0)", ["nothiddendivchild"] );
t( "Check element position", "#select1 option:eq(3)", ["option1d"] );
t( "Check element position", "#qunit-fixture div div:eq(10)", ["names-group"] );
t( "Check element position", "#qunit-fixture div div:first", ["nothiddendivchild"] );
t( "Check element position", "#qunit-fixture div > div:first", ["nothiddendivchild"] );
t( "Check element position", "#dl div:first div:first", ["foo"] );
t( "Check element position", "#dl div:first > div:first", ["foo"] );
t( "Check element position", "div#nothiddendiv:first > div:first", ["nothiddendivchild"] );
Expand All @@ -912,7 +912,7 @@ test("pseudo - position", function() {

// Sizzle extension
Sizzle.selectors.setFilters["primary"] = Sizzle.selectors.setFilters["first"];
t( "Extend Sizzle's POS selectors to rename first to primary", "div:primary", ["qunit-testrunner-toolbar"] );
t( "Extend Sizzle's POS selectors to rename first to primary", "div:primary", ["qunit"] );
// Reset
delete Sizzle.selectors.setFilters["primary"];
});
Expand Down

0 comments on commit b82ec2a

Please sign in to comment.