]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Removed static test pages. Added unit tests for dl markup structure.
authorScott González <scott.gonzalez@gmail.com>
Wed, 23 Mar 2011 14:07:09 +0000 (10:07 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 23 Mar 2011 14:07:09 +0000 (10:07 -0400)
tests/static/accordion/default.html [deleted file]
tests/static/accordion/dl.html [deleted file]
tests/static/accordion/ul.html [deleted file]
tests/unit/accordion/accordio.html
tests/unit/accordion/accordion.html
tests/unit/accordion/accordion_core.js

diff --git a/tests/static/accordion/default.html b/tests/static/accordion/default.html
deleted file mode 100644 (file)
index 2d39cf1..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-       <meta charset="UTF-8" />
-       <title>Accordion Static Test : Default</title>
-       <link rel="stylesheet" href="../static.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
-       <script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
-       <script type="text/javascript" src="../static.js"></script>
-</head>
-<body>
-
-<div class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons">
-               <h3 class="ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-active ui-corner-top" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-s"></span>
-                       <a href="#">Accordion Header 1</a>
-               </h3>
-               <div class="ui-accordion-content ui-accordion-content-active ui-helper-reset ui-widget-content ui-corner-bottom">
-                               Accordion Content 1
-               </div>
-               <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-e"></span>
-                       <a href="#">Accordion Header 2</a>
-               </h3>
-               <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px; display: none;">
-                               Accordion Content 2
-               </div>
-               <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-e"></span>
-                       <a href="#">Accordion Header 3</a>
-               </h3>
-               <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px; display: none;">
-                               Accordion Content 2
-               </div>
-</div>
-
-</body>
-</html>
diff --git a/tests/static/accordion/dl.html b/tests/static/accordion/dl.html
deleted file mode 100644 (file)
index fb7bbd8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-       <meta charset="UTF-8" />
-       <title>Accordion Static Test : DL</title>
-       <link rel="stylesheet" href="../static.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
-       <script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
-       <script type="text/javascript" src="../static.js"></script>
-</head>
-<body>
-
-<dl class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons">
-               <dt class="ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-active ui-corner-top" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-s"></span>
-                       <a href="#">Accordion Header 1</a>
-               </dt>
-               <dd class="ui-accordion-content ui-accordion-content-active ui-helper-reset ui-widget-content ui-corner-bottom">
-                               Accordion Content 1
-               </dd>
-               <dt class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-e"></span>
-                       <a href="#">Accordion Header 2</a>
-               </dt>
-               <dd class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px;">
-                               Accordion Content 2
-               </dd>
-               <dt class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-e"></span>
-                       <a href="#">Accordion Header 3</a>
-               </dt>
-               <dd class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px;">
-                               Accordion Content 2
-               </dd>
-</dl>
-
-</body>
-</html>
diff --git a/tests/static/accordion/ul.html b/tests/static/accordion/ul.html
deleted file mode 100644 (file)
index cc63917..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-       <meta charset="UTF-8" />
-       <title>Accordion Static Test : UL</title>
-       <link rel="stylesheet" href="../static.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
-       <script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
-       <script type="text/javascript" src="../static.js"></script>
-</head>
-<body>
-
-<ul class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons">
-       <li>
-               <h2 class="ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-active ui-corner-top" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-s"></span>
-                       <a href="#">Accordion Header 1</a>
-               </h2>
-               <div class="ui-accordion-content ui-accordion-content-active ui-helper-reset ui-widget-content ui-corner-bottom">
-                       Accordion Content 1
-                       <ul>
-                               <li>Some list item</li>
-                               <li>Some list item</li>
-                       </ul>
-               </div>
-       </li>
-       <li>
-               <h2 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-e"></span>
-                       <a href="#">Accordion Header 2</a>
-               </h2>
-               <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px;">
-                       Accordion Content 2
-               </div>
-       </li>
-       <li>
-               <h2 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
-                       <span class="ui-icon ui-icon-triangle-1-e"></span>
-                       <a href="#">Accordion Header 3</a>
-               </h2>
-               <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px;">
-                       Accordion Content 3
-               </div>
-       </li>   
-</ul>
-
-</body>
-</html>
index fe0e1b3110b978ec2ff9f395676f6e6861dea822..4e4df72b4a9f9d366cdc43c61774092363643226 100644 (file)
        </ul>
 </div>
 
+<dl id="accordion-dl">
+       <dt>
+               <a href="#">Accordion Header 1</a>
+       </dt>
+       <dd>
+               Accordion Content 1
+       </dd>
+       <dt>
+               <a href="#">Accordion Header 2</a>
+       </dt>
+       <dd>
+               Accordion Content 2
+       </dd>
+       <dt>
+               <a href="#">Accordion Header 3</a>
+       </dt>
+       <dd>
+               Accordion Content 3
+       </dd>
+</dl>
+
 </div>
 </body>
 </html>
index bf5b0a0e868d3011b5b8cc4a6060b3247a994fc8..65fd16ab643074f5592032b04960842148638000 100644 (file)
        </ul>
 </div>
 
+<dl id="accordion-dl">
+       <dt>
+               <a href="#">Accordion Header 1</a>
+       </dt>
+       <dd>
+               Accordion Content 1
+       </dd>
+       <dt>
+               <a href="#">Accordion Header 2</a>
+       </dt>
+       <dd>
+               Accordion Content 2
+       </dd>
+       <dt>
+               <a href="#">Accordion Header 3</a>
+       </dt>
+       <dd>
+               Accordion Content 3
+       </dd>
+</dl>
+
 </div>
 </body>
 </html>
index 26395985185c12e3b3b308f8a712175835c9477c..05479faf9242065a3327812971a504f13399ebb4 100644 (file)
@@ -2,16 +2,18 @@
 
 module( "accordion: core", accordionSetupTeardown() );
 
-test( "markup structure", function() {
-       var ac = $( "#navigation" ).accordion();
-       ok( ac.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
-       equal( ac.find( ".ui-accordion-header" ).length, 3,
-               ".ui-accordion-header elements exist, correct number" );
-       equal( ac.find( ".ui-accordion-content" ).length, 3,
-               ".ui-accordion-content elements exist, correct number" );
-       same( ac.find( ".ui-accordion-header" ).next().get(),
-               ac.find( ".ui-accordion-content" ).get(),
-               "content panels come immediately after headers" );
+$.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( type, selector ) {
+       test( "markup structure: " + type, function() {
+               var ac = $( selector ).accordion();
+               ok( ac.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
+               equal( ac.find( ".ui-accordion-header" ).length, 3,
+                       ".ui-accordion-header elements exist, correct number" );
+               equal( ac.find( ".ui-accordion-content" ).length, 3,
+                       ".ui-accordion-content elements exist, correct number" );
+               same( ac.find( ".ui-accordion-header" ).next().get(),
+                       ac.find( ".ui-accordion-content" ).get(),
+                       "content panels come immediately after headers" );
+       });
 });
 
 test( "handle click on header-descendant", function() {