]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion unit tets: Replacing destory method test with autocomplete/button approach...
authorjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Mar 2010 07:01:41 +0000 (08:01 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Mar 2010 07:01:41 +0000 (08:01 +0100)
tests/unit/accordion/accordion.html
tests/unit/accordion/accordion_methods.js

index 4173ed9f1cd3b27a15ae449d65266d2c97f6f7bf..df09798030670e95a8cdf5f283224f4033f43d4d 100644 (file)
 
 <div id="main" style="position: absolute; top: -10000px; left: -10000px;">
 
-       <div id="list1">
-        <a>There is one obvious advantage:</a>
-        <div>
-            <p>
-                You've seen it coming!
-                <br/>
-                Buy now and get nothing for free!
-                <br/>
-                Well, at least no free beer. Perhaps a bear, if you can afford it.
-            </p>
-        </div>
-        <a>Now that you've got...</a>
-        <div>
-            <p>
-                your bear, you have to admit it!
-                <br/>
-                No, we aren't selling bears.
-            </p>
-            <p>
-                We could talk about renting one.
-            </p>
-        </div>
-        <a>Rent one bear, ...</a>
-        <div>
-            <p>
-                get two for three beer.
-            </p>
-            <p>
-                And now, for something completely different.
-            </p>
-        </div>
+       <div>
+               <div id="list1" class="foo">
+               <a class="bar">There is one obvious advantage:</a>
+               <div style="" class="foo">
+                   <p>
+                       You've seen it coming!
+                       <br/>
+                       Buy now and get nothing for free!
+                       <br/>
+                       Well, at least no free beer. Perhaps a bear, if you can afford it.
+                   </p>
+               </div>
+               <a class="bar">Now that you've got...</a>
+               <div style="" class="foo">
+                   <p>
+                       your bear, you have to admit it!
+                       <br/>
+                       No, we aren't selling bears.
+                   </p>
+                   <p>
+                       We could talk about renting one.
+                   </p>
+               </div>
+               <a class="bar">Rent one bear, ...</a>
+               <div style="" class="foo">
+                   <p>
+                       get two for three beer.
+                   </p>
+                   <p>
+                       And now, for something completely different.
+                   </p>
+               </div>
+               </div>
        </div>
 
 <div id="navigationWrapper">
index 6761d24a67b529ed93f2dcc3760d0430445c07d0..d15a0b710542659463bfac43728a3c44d10df4b1 100644 (file)
@@ -40,21 +40,9 @@ test("init", function() {
 });
 
 test("destroy", function() {
-       $("<div></div>").appendTo('body').accordion().accordion("destroy").remove();
-       ok(true, '.accordion("destroy") called on element');
-
-       $([]).accordion().accordion("destroy").remove();
-       ok(true, '.accordion("destroy") called on empty collection');
-
-       $('<div></div>').accordion().accordion("destroy").remove();
-       ok(true, '.accordion("destroy") called on disconnected DOMElement');
-
-       $('<div></div>').accordion().accordion("destroy").accordion("foo").remove();
-       ok(true, 'arbitrary method called after destroy');
-
-       var expected = $('<div></div>').accordion(),
-               actual = expected.accordion('destroy');
-       equals(actual, expected, 'destroy is chainable');
+       var beforeHtml = $("#list1").parent().html();
+       var afterHtml = $("#list1").accordion().accordion("destroy").parent().html();
+       equal( afterHtml, beforeHtml );
 });
 
 test("enable", function() {