aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-12-25 18:25:46 +0000
committerScott González <scott.gonzalez@gmail.com>2009-12-25 18:25:46 +0000
commit9a786e03a1edda7efb31b0ad6b20e5bcd62d9482 (patch)
tree843ac9b2469ae29571a4b243c07005eb846b5c02 /tests
parent4a995c68d4a9a36ae41b0c3d38bfa3f105407190 (diff)
downloadjquery-ui-9a786e03a1edda7efb31b0ad6b20e5bcd62d9482.tar.gz
jquery-ui-9a786e03a1edda7efb31b0ad6b20e5bcd62d9482.zip
Tabs: fixed to work with empty nav list again.
Fixes #4997 - No longer possible to start with empty tab then add() elements dynamically.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tabs/tabs.html28
-rw-r--r--tests/unit/tabs/tabs_core.js21
2 files changed, 47 insertions, 2 deletions
diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html
index 0675fc308..b45f544d9 100644
--- a/tests/unit/tabs/tabs.html
+++ b/tests/unit/tabs/tabs.html
@@ -42,6 +42,34 @@
<div id="colon:test"></div>
<div style="height: 300px;" id="inline-style"></div>
</div>
+ <div id="tabs3">
+ <div>
+ <ul id="tabs3-list">
+ <li><a href="#tabs3-1">1</a></li>
+ </ul>
+ </div>
+ </div>
+ <div id="tabs4">
+ <ul id="tabs4-list">
+ <li><a href="#tabs4-1">1</a></li>
+ </ul>
+ <ol>
+ <li><a href="#tabs4-1">1</a></li>
+ </ol>
+ </div>
+ <div id="tabs4a">
+ <ol id="tabs4a-list">
+ <li><a href="#tabs4a-1">1</a></li>
+ </ol>
+ <ul>
+ <li><a href="#tabs4a-1">1</a></li>
+ </ul>
+ </div>
+ <div id="tabs5">
+ <div>
+ <ul id="tabs5-list"></ul>
+ </div>
+ </div>
</div>
</body>
</html>
diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js
index 79e95ea41..20ab2b1fd 100644
--- a/tests/unit/tabs/tabs_core.js
+++ b/tests/unit/tabs/tabs_core.js
@@ -7,6 +7,24 @@ var el;
module("tabs: core");
+test('navigation markup', function() {
+ el = $('#tabs3').tabs();
+ ok($('#tabs3-list').hasClass('ui-tabs-nav'), 'custom markup; allow list to be any descendant');
+ el.tabs('destroy');
+
+ el = $('#tabs4').tabs();
+ ok($('#tabs4-list').hasClass('ui-tabs-nav'), 'first list found becomes nav - ul');
+ el.tabs('destroy');
+
+ el = $('#tabs4a').tabs();
+ ok($('#tabs4a-list').hasClass('ui-tabs-nav'), 'first list found becomes nav - ol');
+ el.tabs('destroy');
+
+ el = $('#tabs5').tabs();
+ ok($('#tabs5-list').hasClass('ui-tabs-nav'), 'empty list can be used');
+ el.tabs('destroy');
+});
+
test('ajax', function() {
expect(4);
stop();
@@ -34,6 +52,5 @@ test('ajax', function() {
});
});
-
-
+
})(jQuery);