aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-03-27 08:01:41 +0100
committerjzaefferer <joern.zaefferer@gmail.com>2010-03-27 08:01:41 +0100
commitd5a6b334669c8024573b8aa52014c83f3823f0c2 (patch)
treebc7152b293a7d32ee27bc9fd3b728987b72a623c /tests
parent11e719f8f84468b7eac44fd19521ddf8eaa360f5 (diff)
downloadjquery-ui-d5a6b334669c8024573b8aa52014c83f3823f0c2.tar.gz
jquery-ui-d5a6b334669c8024573b8aa52014c83f3823f0c2.zip
Accordion unit tets: Replacing destory method test with autocomplete/button approach, comparing before/after html - had to add some classes and empty style attributes to ignore class='' and style='', harmless enough
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/accordion/accordion.html64
-rw-r--r--tests/unit/accordion/accordion_methods.js18
2 files changed, 36 insertions, 46 deletions
diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html
index 4173ed9f1..df0979803 100644
--- a/tests/unit/accordion/accordion.html
+++ b/tests/unit/accordion/accordion.html
@@ -38,37 +38,39 @@
<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">
diff --git a/tests/unit/accordion/accordion_methods.js b/tests/unit/accordion/accordion_methods.js
index 6761d24a6..d15a0b710 100644
--- a/tests/unit/accordion/accordion_methods.js
+++ b/tests/unit/accordion/accordion_methods.js
@@ -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() {