diff options
author | Kevin Attfield <k.attfield@gmail.com> | 2012-10-09 09:29:44 +0400 |
---|---|---|
committer | Kevin Attfield <k.attfield@gmail.com> | 2012-10-09 09:29:44 +0400 |
commit | 48a8dd2a23f11981d42785db4091c029b5b7e781 (patch) | |
tree | 65588ea9a86c2b85732afb806ad2be349ea4cd63 | |
parent | 82715ae96dad4e97d208acf7f1654b25449e2bef (diff) |
Added test to fix for #5362
-rw-r--r-- | js/tests/unit/bootstrap-tab.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-tab.js b/js/tests/unit/bootstrap-tab.js index 9878047810..40f9a7406d 100644 --- a/js/tests/unit/bootstrap-tab.js +++ b/js/tests/unit/bootstrap-tab.js @@ -58,4 +58,23 @@ $(function () { .tab('show') }) + test("show and shown events should reference correct relatedTarget", function () { + var dropHTML = + '<ul class="drop">' + + '<li class="dropdown"><a data-toggle="dropdown" href="#">1</a>' + + '<ul class="dropdown-menu">' + + '<li><a href="#1-1" data-toggle="tab">1-1</a></li>' + + '<li><a href="#1-2" data-toggle="tab">1-2</a></li>' + + '</ul>' + + '</li>' + + '</ul>' + + $(dropHTML).find('ul>li:first a').tab('show').end() + .find('ul>li:last a').on('show', function(event){ + equals(event.relatedTarget.hash, "#1-1") + }).on('shown', function(event){ + equals(event.relatedTarget.hash, "#1-1") + }).tab('show') + }) + })
\ No newline at end of file |