diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-03-23 10:07:09 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-03-23 10:07:09 -0400 |
commit | b85e11564ab16eb420ecccdcb8e328e37458c8f3 (patch) | |
tree | b7b268a196d2c30a67555a28f83aef358e169812 | |
parent | aaa21ddb0ce5c3b7e352ce8e7680bc5b37092401 (diff) | |
download | jquery-ui-b85e11564ab16eb420ecccdcb8e328e37458c8f3.tar.gz jquery-ui-b85e11564ab16eb420ecccdcb8e328e37458c8f3.zip |
Accordion: Removed static test pages. Added unit tests for dl markup structure.
-rw-r--r-- | tests/static/accordion/default.html | 39 | ||||
-rw-r--r-- | tests/static/accordion/dl.html | 39 | ||||
-rw-r--r-- | tests/static/accordion/ul.html | 49 | ||||
-rw-r--r-- | tests/unit/accordion/accordio.html | 21 | ||||
-rw-r--r-- | tests/unit/accordion/accordion.html | 21 | ||||
-rw-r--r-- | tests/unit/accordion/accordion_core.js | 22 |
6 files changed, 54 insertions, 137 deletions
diff --git a/tests/static/accordion/default.html b/tests/static/accordion/default.html deleted file mode 100644 index 2d39cf123..000000000 --- a/tests/static/accordion/default.html +++ /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 index fb7bbd80d..000000000 --- a/tests/static/accordion/dl.html +++ /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 index cc6391763..000000000 --- a/tests/static/accordion/ul.html +++ /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> diff --git a/tests/unit/accordion/accordio.html b/tests/unit/accordion/accordio.html index fe0e1b311..4e4df72b4 100644 --- a/tests/unit/accordion/accordio.html +++ b/tests/unit/accordion/accordio.html @@ -136,6 +136,27 @@ </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> diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index bf5b0a0e8..65fd16ab6 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -138,6 +138,27 @@ </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> diff --git a/tests/unit/accordion/accordion_core.js b/tests/unit/accordion/accordion_core.js index 263959851..05479faf9 100644 --- a/tests/unit/accordion/accordion_core.js +++ b/tests/unit/accordion/accordion_core.js @@ -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() { |