aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/tabs_events.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-12-31 13:43:54 +0000
committerRichard Worth <rdworth@gmail.com>2009-12-31 13:43:54 +0000
commit41749bf12209157475806cfe0a4e6d37c5a06bf1 (patch)
treec44beb36d91e3fa212b5554e8db921259dd62918 /tests/unit/tabs/tabs_events.js
parent5ab4b615a52e1b826d4db37a2174d2abca7056ac (diff)
downloadjquery-ui-41749bf12209157475806cfe0a4e6d37c5a06bf1.tar.gz
jquery-ui-41749bf12209157475806cfe0a4e6d37c5a06bf1.zip
Fixed #4960 - Tabs: wrong selected tab index
Diffstat (limited to 'tests/unit/tabs/tabs_events.js')
-rw-r--r--tests/unit/tabs/tabs_events.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js
index 4acf15225..2c0eaac18 100644
--- a/tests/unit/tabs/tabs_events.js
+++ b/tests/unit/tabs/tabs_events.js
@@ -30,7 +30,16 @@ test('show', function() {
});
test('add', function() {
- ok(false, "missing test - untested code is broken code.");
+
+ var el = $('<div id="tabs"><ul></ul></div>').tabs();
+ equals(el.tabs('option', 'selected'), -1, 'Initially empty, no selected tab');
+
+ el.tabs('add', '#test1', 'Test 1');
+ equals(el.tabs('option', 'selected'), 0, 'First tab added should be auto selected');
+
+ el.tabs('add', '#test2', 'Test 2');
+ equals(el.tabs('option', 'selected'), 0, 'Second tab added should not be auto selected');
+
});
test('remove', function() {