mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Added test to fix for #5362
This commit is contained in:
parent
82715ae96d
commit
48a8dd2a23
1 changed files with 19 additions and 0 deletions
19
js/tests/unit/bootstrap-tab.js
vendored
19
js/tests/unit/bootstrap-tab.js
vendored
|
@ -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')
|
||||
})
|
||||
|
||||
})
|
Loading…
Reference in a new issue