Skip to content
This repository
Browse code

Test: Update index.html to new QUnit format. Close gh-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...
commit 71467207315eaac67dc6ba00992fe0f7998a8cb4 1 parent 8d91687
Timo Tijhof Krinkle authored dmethvin committed

Showing 2 changed files with 26 additions and 26 deletions. Show diff stats Hide diff stats

  1. +10 10 test/index.html
  2. +16 16 test/unit/selector.js
20 test/index.html
@@ -13,16 +13,9 @@
13 13 </head>
14 14
15 15 <body id="body">
16   - <h1 id="qunit-header">Sizzle Test Suite</h1>
17   - <h2 id="qunit-banner"></h2>
18   - <div id="qunit-testrunner-toolbar"></div>
19   - <h2 id="qunit-userAgent"></h2>
20   - <ol id="qunit-tests"></ol>
  16 + <div id="qunit"></div>
21 17
22 18 <!-- Test HTML -->
23   - <div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
24   - <div id="nothiddendivchild"></div>
25   - </div>
26 19 <dl id="dl" style="position:absolute;top:-32767px;left:-32767px;width:1px">
27 20 <div id="qunit-fixture">
28 21 <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>
@@ -39,6 +32,9 @@ <h2 id="qunit-userAgent"></h2>
39 32 <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>
40 33
41 34 </div>
  35 + <div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
  36 + <div id="nothiddendivchild"></div>
  37 + </div>
42 38 <span id="name+value"></span>
43 39 <p id="first">Try them out:</p>
44 40 <ul id="firstUL"></ul>
@@ -191,6 +187,10 @@ <h2 id="qunit-userAgent"></h2>
191 187 <input type="hidden" id="el12087" data-comma="0,1"/>
192 188 </div>
193 189 <div id="no-clone-exception"><object><embed></embed></object></div>
  190 + <div id="names-group">
  191 + <span id="name-is-example" name="example"></span>
  192 + <span id="name-is-div" name="div"></span>
  193 + </div>
194 194 </div>
195 195
196 196 <div id="tabindex-tests">
@@ -230,8 +230,8 @@ <h2 id="qunit-userAgent"></h2>
230 230 </div>
231 231 </dl>
232 232 <div id="fx-test-group" style="position:absolute;width:1px;height:1px;overflow:hidden;">
233   - <div id="fx-queue" name="test">
234   - <div id="fadein" class='chain test' name='div'>fadeIn<div>fadeIn</div></div>
  233 + <div id="fx-queue">
  234 + <div id="fadein" class='chain test'>fadeIn<div>fadeIn</div></div>
235 235 <div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>
236 236
237 237 <div id="show" class='chain test'>show<div>show</div></div>
32 test/unit/selector.js
@@ -101,8 +101,8 @@ test("element", function() {
101 101 t( "Trailing line feed", "#qunit-fixture p\n", ["firstp","ap","sndp","en","sap","first"] );
102 102 t( "Trailing form feed", "#qunit-fixture p\f", ["firstp","ap","sndp","en","sap","first"] );
103 103
104   - t( "Parent Element", "div p", ["firstp","ap","sndp","en","sap","first"] );
105   - t( "Parent Element (non-space descendant combinator)", "div\tp", ["firstp","ap","sndp","en","sap","first"] );
  104 + t( "Parent Element", "#qunit-fixture p", ["firstp","ap","sndp","en","sap","first"] );
  105 + t( "Parent Element (non-space descendant combinator)", "#qunit-fixture\tp", ["firstp","ap","sndp","en","sap","first"] );
106 106 var obj1 = document.getElementById("object1");
107 107 equal( Sizzle("param", obj1).length, 2, "Object/param as context" );
108 108
@@ -268,7 +268,7 @@ test("id", function() {
268 268 deepEqual( Sizzle("div#form", document.body), [], "ID selector within the context of another element" );
269 269
270 270 t( "Underscore ID", "#types_all", ["types_all"] );
271   - t( "Dash ID", "#fx-queue", ["fx-queue"] );
  271 + t( "Dash ID", "#qunit-fixture", ["qunit-fixture"] );
272 272
273 273 t( "ID with weird characters in it", "#name\\+value", ["name+value"] );
274 274 });
@@ -323,8 +323,8 @@ test("name", function() {
323 323 t( "Name selector with single quotes", "input[name='action']", ["text1"] );
324 324 t( "Name selector with double quotes", 'input[name="action"]', ["text1"] );
325 325
326   - t( "Name selector non-input", "[name=test]", ["length", "fx-queue"] );
327   - t( "Name selector non-input", "[name=div]", ["fadein"] );
  326 + t( "Name selector non-input", "[name=example]", ["name-is-example"] );
  327 + t( "Name selector non-input", "[name=div]", ["name-is-div"] );
328 328 t( "Name selector non-input", "*[name=iframe]", ["iframe"] );
329 329
330 330 t( "Name selector for grouped input", "input[name='types[]']", ["types_all", "types_anime", "types_movie"] );
@@ -381,7 +381,7 @@ test("child and adjacent", function() {
381 381 t( "Adjacent", "p[lang=en] + p", ["sap"] );
382 382 t( "Adjacent", "a.GROUPS + code + a", ["mark"] );
383 383 t( "Comma, Child, and Adjacent", "#qunit-fixture a + a, code > a", ["groups","anchor1","anchor2"] );
384   - t( "Element Preceded By", "#qunit-fixture p ~ div", ["foo", "moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
  384 + t( "Element Preceded By", "#qunit-fixture p ~ div", ["foo", "nothiddendiv", "moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
385 385 t( "Element Preceded By", "#first ~ div", ["moretests","tabindex-tests", "liveHandlerOrder", "siblingTest"] );
386 386 t( "Element Preceded By", "#groups ~ a", ["mark"] );
387 387 t( "Element Preceded By", "#length ~ input", ["idTest"] );
@@ -652,7 +652,7 @@ test("pseudo - nth-of-type", function() {
652 652 t( "Nth-of-type(even)", "#ap :nth-of-type(even)", ["groups"] );
653 653 t( "Nth-of-type(2n+1)", "#ap :nth-of-type(2n+1)", ["google", "code1", "anchor1", "mark"] );
654 654 t( "Nth-of-type(odd)", "#ap :nth-of-type(odd)", ["google", "code1", "anchor1", "mark"] );
655   - 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"] );
  655 + 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"] );
656 656 });
657 657
658 658 test("pseudo - nth-last-of-type", function() {
@@ -845,7 +845,7 @@ test("pseudo - :not", function() {
845 845 t( ":not() Multiple Class", "#foo a:not(.link)", ["yahoo", "anchor2"] );
846 846 t( ":not() Multiple Class", "#foo a:not(.blog.link)", ["yahoo", "anchor2"] );
847 847
848   - t( ":not chaining (compound)", "#qunit-fixture div[id]:not(:has(div, span)):not(:has(*))", ["divWithNoTabIndex"] );
  848 + t( ":not chaining (compound)", "#qunit-fixture div[id]:not(:has(div, span)):not(:has(*))", ["nothiddendivchild", "divWithNoTabIndex"] );
849 849 t( ":not chaining (with attribute)", "#qunit-fixture form[id]:not([action$='formaction']):not(:button)", ["lengthtest", "name-tests", "testForm"] );
850 850 t( ":not chaining (colon in attribute)", "#qunit-fixture form[id]:not([action='form:action']):not(:button)", ["form", "lengthtest", "name-tests", "testForm"] );
851 851 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"] );
@@ -867,8 +867,8 @@ test("pseudo - :not", function() {
867 867 test("pseudo - position", function() {
868 868 expect( 34 );
869 869
870   - t( "First element", "div:first", ["qunit-testrunner-toolbar"] );
871   - t( "First element(case-insensitive)", "div:fiRst", ["qunit-testrunner-toolbar"] );
  870 + t( "First element", "div:first", ["qunit"] );
  871 + t( "First element(case-insensitive)", "div:fiRst", ["qunit"] );
872 872 t( "nth Element", "#qunit-fixture p:nth(1)", ["ap"] );
873 873 t( "First Element", "#qunit-fixture p:first", ["firstp"] );
874 874 t( "Last Element", "p:last", ["first"] );
@@ -889,11 +889,11 @@ test("pseudo - position", function() {
889 889 t( "Check position filtering", "div.nothiddendiv:last", ["nothiddendiv"] );
890 890 t( "Check position filtering", "div.nothiddendiv:not(:lt(0))", ["nothiddendiv"] );
891 891
892   - t( "Check element position", "div div:eq(0)", ["nothiddendivchild"] );
893   - t( "Check element position", "div div:eq(5)", ["t2037"] );
894   - t( "Check element position", "div div:eq(29)", ["slideup"] );
895   - t( "Check element position", "div div:first", ["nothiddendivchild"] );
896   - t( "Check element position", "div > div:first", ["nothiddendivchild"] );
  892 + t( "Check element position", "#qunit-fixture div div:eq(0)", ["nothiddendivchild"] );
  893 + t( "Check element position", "#select1 option:eq(3)", ["option1d"] );
  894 + t( "Check element position", "#qunit-fixture div div:eq(10)", ["names-group"] );
  895 + t( "Check element position", "#qunit-fixture div div:first", ["nothiddendivchild"] );
  896 + t( "Check element position", "#qunit-fixture div > div:first", ["nothiddendivchild"] );
897 897 t( "Check element position", "#dl div:first div:first", ["foo"] );
898 898 t( "Check element position", "#dl div:first > div:first", ["foo"] );
899 899 t( "Check element position", "div#nothiddendiv:first > div:first", ["nothiddendivchild"] );
@@ -912,7 +912,7 @@ test("pseudo - position", function() {
912 912
913 913 // Sizzle extension
914 914 Sizzle.selectors.setFilters["primary"] = Sizzle.selectors.setFilters["first"];
915   - t( "Extend Sizzle's POS selectors to rename first to primary", "div:primary", ["qunit-testrunner-toolbar"] );
  915 + t( "Extend Sizzle's POS selectors to rename first to primary", "div:primary", ["qunit"] );
916 916 // Reset
917 917 delete Sizzle.selectors.setFilters["primary"];
918 918 });

0 comments on commit 7146720

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