]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion tests: cleanup.
authorScott González <scott.gonzalez@gmail.com>
Wed, 3 Aug 2011 17:52:36 +0000 (13:52 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 3 Aug 2011 17:52:36 +0000 (13:52 -0400)
tests/unit/accordion/accordion.html
tests/unit/accordion/accordion_deprecated.html
tests/unit/accordion/accordion_test_helpers.js [new file with mode: 0644]

index 9e23a1243d0eb5f742cbcfd02a3e6ad47477b871..5bc31a9265f08f568554bc69bec546aaf81c690e 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Accordion Test Suite</title>
 
+       <link rel="stylesheet" href="../../../themes/base/jquery.ui.core.css">
        <link rel="stylesheet" href="../../../themes/base/jquery.ui.accordion.css">
 
        <script src="../../jquery.js"></script>
        <script src="../../jquery.simulate.js"></script>
        <script src="../testsuite.js"></script>
 
-       <script>
-       function accordion_state( accordion ) {
-               var expected = $.makeArray( arguments ).slice( 1 );
-               var actual = accordion.find( ".ui-accordion-content" ).map(function() {
-                       return $( this ).css( "display" ) === "none" ? 0 : 1;
-               }).get();
-               deepEqual( actual, expected );
-       }
-       function accordion_equalHeights( accordion, min, max ) {
-               var sizes = [];
-               accordion.find( ".ui-accordion-content" ).each(function() {
-                       sizes.push( $( this ).outerHeight() );
-               });
-               ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
-                       "must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
-               deepEqual( sizes[ 0 ], sizes[ 1 ] );
-               deepEqual( sizes[ 0 ], sizes[ 2 ] );
-       }
-       function accordionSetupTeardown() {
-               var animated = $.ui.accordion.prototype.options.animated;
-               return {
-                       setup: function() {
-                               $.ui.accordion.prototype.options.animated = false;
-                       },
-                       teardown: function() {
-                               $.ui.accordion.prototype.options.animated = animated;
-                       }
-               };
-       }
-       </script>
+       <script src="accordion_test_helpers.js"></script>
        <script src="accordion_defaults.js"></script>
        <script src="accordion_core.js"></script>
        <script src="accordion_events.js"></script>
 
        <script src="../swarminject.js"></script>
        <style>
-       #qunit-fixture { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
-       #list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; line-height: 15px; }
+       #list, #list1 *, #navigation, #navigation * {
+               margin: 0;
+               padding: 0;
+               font-size: 12px;
+               line-height: 15px;
+       }
        </style>
 </head>
 <body>
index 7ba6d47e4eacfed1a2317979b1e8ff2e853019e4..a2b0493b6aca630ff6b6212fbd499398f3831003 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Accordion Test Suite</title>
 
+       <link rel="stylesheet" href="../../../themes/base/jquery.ui.core.css">
        <link rel="stylesheet" href="../../../themes/base/jquery.ui.accordion.css">
 
        <script src="../../jquery.js"></script>
        <script src="../../jquery.simulate.js"></script>
        <script src="../testsuite.js"></script>
 
-       <script>
-       function accordion_state( accordion ) {
-               var expected = $.makeArray( arguments ).slice( 1 );
-               var actual = accordion.find( ".ui-accordion-content" ).map(function() {
-                       return $( this ).css( "display" ) === "none" ? 0 : 1;
-               }).get();
-               deepEqual( actual, expected );
-       }
-       function accordion_equalHeights( accordion, min, max ) {
-               var sizes = [];
-               accordion.find( ".ui-accordion-content" ).each(function() {
-                       sizes.push( $( this ).outerHeight() );
-               });
-               ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
-                       "must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
-               deepEqual( sizes[ 0 ], sizes[ 1 ] );
-               deepEqual( sizes[ 0 ], sizes[ 2 ] );
-       }
-       function accordionSetupTeardown() {
-               var animated = $.ui.accordion.prototype.options.animated;
-               return {
-                       setup: function() {
-                               $.ui.accordion.prototype.options.animated = false;
-                       },
-                       teardown: function() {
-                               $.ui.accordion.prototype.options.animated = animated;
-                       }
-               };
-       }
-       </script>
+       <script src="accordion_test_helpers.js"></script>
        <script src="accordion_defaults_deprecated.js"></script>
        <script src="accordion_core.js"></script>
        <script src="accordion_events.js"></script>
 
        <script src="../swarminject.js"></script>
        <style>
-       #qunit-fixture { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
-       #list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; line-height: 15px; }
+       #list, #list1 *, #navigation, #navigation * {
+               margin: 0;
+               padding: 0;
+               font-size: 12px;
+               line-height: 15px;
+       }
        </style>
 </head>
 <body>
diff --git a/tests/unit/accordion/accordion_test_helpers.js b/tests/unit/accordion/accordion_test_helpers.js
new file mode 100644 (file)
index 0000000..cdda7a7
--- /dev/null
@@ -0,0 +1,30 @@
+function accordion_state( accordion ) {
+       var expected = $.makeArray( arguments ).slice( 1 );
+       var actual = accordion.find( ".ui-accordion-content" ).map(function() {
+               return $( this ).css( "display" ) === "none" ? 0 : 1;
+       }).get();
+       deepEqual( actual, expected );
+}
+
+function accordion_equalHeights( accordion, min, max ) {
+       var sizes = [];
+       accordion.find( ".ui-accordion-content" ).each(function() {
+               sizes.push( $( this ).outerHeight() );
+       });
+       ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
+               "must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
+       deepEqual( sizes[ 0 ], sizes[ 1 ] );
+       deepEqual( sizes[ 0 ], sizes[ 2 ] );
+}
+
+function accordionSetupTeardown() {
+       var animated = $.ui.accordion.prototype.options.animated;
+       return {
+               setup: function() {
+                       $.ui.accordion.prototype.options.animated = false;
+               },
+               teardown: function() {
+                       $.ui.accordion.prototype.options.animated = animated;
+               }
+       };
+}