diff options
author | Klaus Hartl <klaus.hartl@googlemail.com> | 2009-01-19 23:11:30 +0000 |
---|---|---|
committer | Klaus Hartl <klaus.hartl@googlemail.com> | 2009-01-19 23:11:30 +0000 |
commit | 59c6f97625cf6f149af7543b1739aa8d22737e6e (patch) | |
tree | 58d3c66d26d2fc42b5a8513da1249fe90bbf06e3 /tests/unit/tabs | |
parent | 8f4ae539f3d09cd6e4f6348dcb9b8b5846d69c12 (diff) | |
download | jquery-ui-59c6f97625cf6f149af7543b1739aa8d22737e6e.tar.gz jquery-ui-59c6f97625cf6f149af7543b1739aa8d22737e6e.zip |
UI Tabs: url containing a fragment identfier broke Ajax tab loading, fixes #3627
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r-- | tests/unit/tabs/tabs.html | 5 | ||||
-rw-r--r-- | tests/unit/tabs/tabs.js | 19 |
2 files changed, 15 insertions, 9 deletions
diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html index b6d466adb..939553429 100644 --- a/tests/unit/tabs/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -16,9 +16,7 @@ <script type="text/javascript" src="tabs.js"></script> </head> <body> - <div id="main"> - <div id="tabs1"> <ul> <li><a href="#fragment-1">1</a></li> @@ -33,12 +31,11 @@ <ul> <li><a href="#colon:test">1</a></li> <li><a href="#inline-style">2</a></li> + <li><a href="test.html#test">1</a></li> </ul> <div id="colon:test"></div> <div style="height: 300px;" id="inline-style"></div> </div> - </div> - </body> </html> diff --git a/tests/unit/tabs/tabs.js b/tests/unit/tabs/tabs.js index a5257dbfc..90c52a246 100644 --- a/tests/unit/tabs/tabs.js +++ b/tests/unit/tabs/tabs.js @@ -83,7 +83,8 @@ module('tabs'); test('remove', function() { expect(4); - var el = $('#tabs1 > ul').tabs(); + var el = $('#tabs1').tabs(); + el.tabs('remove', 0); equals(el.tabs('length'), 2, 'remove tab'); equals($('li a[href$="fragment-1"]', el).length, 0, 'remove associated list item'); @@ -92,10 +93,9 @@ module('tabs'); // TODO delete tab -> focus tab to right // TODO delete last tab -> focus tab to left - el = $('#tabs2 > ul').tabs({ selected: 1 }); + el.tabs('select', 1); el.tabs('remove', 1); - equals(el.data('selected.tabs'), 0, 'update selected property'); - + equals(el.data('selected.tabs'), 0, 'update selected property'); }); test('enable', function() { @@ -219,7 +219,7 @@ module('tabs: Tickets'); }; var expected = inlineStyle('height'); - var el = $('#tabs2 > ul').tabs(); + var el = $('#tabs2').tabs(); equals(inlineStyle('height'), expected, 'init should not remove inline style'); el.tabs('select', 1); @@ -234,6 +234,15 @@ module('tabs: Tickets'); }); }); + + test('Ajax tab with url containing a fragment identifier fails to load, #3627', function() { // http://ui.jquery.com/bugs/ticket/3627 + expect(1); + + var el = $('#tabs2').tabs(); + + equals( $('a:eq(2)', el).data('load.tabs'), 'test.html', 'should ignore fragment identifier' ); + + }); // test('', function() { // expect(0); |