Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/bootstrap-tab.js')
-rw-r--r--js/tests/unit/bootstrap-tab.js19
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