mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-14 18:42:30 +03:00
update JS unit tests to future-proof QUnit 1.16.0 API
[skip validator]
This commit is contained in:
@@ -157,7 +157,7 @@ $(function () {
|
||||
strictEqual($('#qunit-fixture .open').length, 0, '"open" class removed')
|
||||
})
|
||||
|
||||
test('should fire show and hide event', function () {
|
||||
test('should fire show and hide event', function (assert) {
|
||||
var dropdownHTML = '<ul class="tabs">'
|
||||
+ '<li class="dropdown">'
|
||||
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
|
||||
@@ -174,7 +174,7 @@ $(function () {
|
||||
.find('[data-toggle="dropdown"]')
|
||||
.bootstrapDropdown()
|
||||
|
||||
stop()
|
||||
var done = assert.async()
|
||||
|
||||
$dropdown
|
||||
.parent('.dropdown')
|
||||
@@ -183,7 +183,7 @@ $(function () {
|
||||
})
|
||||
.on('hide.bs.dropdown', function () {
|
||||
ok(true, 'hide was fired')
|
||||
start()
|
||||
done()
|
||||
})
|
||||
|
||||
$dropdown.click()
|
||||
@@ -191,7 +191,7 @@ $(function () {
|
||||
})
|
||||
|
||||
|
||||
test('should fire shown and hidden event', function () {
|
||||
test('should fire shown and hidden event', function (assert) {
|
||||
var dropdownHTML = '<ul class="tabs">'
|
||||
+ '<li class="dropdown">'
|
||||
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
|
||||
@@ -208,7 +208,7 @@ $(function () {
|
||||
.find('[data-toggle="dropdown"]')
|
||||
.bootstrapDropdown()
|
||||
|
||||
stop()
|
||||
var done = assert.async()
|
||||
|
||||
$dropdown
|
||||
.parent('.dropdown')
|
||||
@@ -217,15 +217,15 @@ $(function () {
|
||||
})
|
||||
.on('hidden.bs.dropdown', function () {
|
||||
ok(true, 'hidden was fired')
|
||||
start()
|
||||
done()
|
||||
})
|
||||
|
||||
$dropdown.click()
|
||||
$(document.body).click()
|
||||
})
|
||||
|
||||
test('should ignore keyboard events within <input>s and <textarea>s', function () {
|
||||
stop()
|
||||
test('should ignore keyboard events within <input>s and <textarea>s', function (assert) {
|
||||
var done = assert.async()
|
||||
|
||||
var dropdownHTML = '<ul class="tabs">'
|
||||
+ '<li class="dropdown">'
|
||||
@@ -259,7 +259,7 @@ $(function () {
|
||||
$textarea.focus().trigger($.Event('keydown', { which: 38 }))
|
||||
ok($(document.activeElement).is($textarea), 'textarea still focused')
|
||||
|
||||
start()
|
||||
done()
|
||||
})
|
||||
|
||||
$dropdown.click()
|
||||
|
||||
Reference in New Issue
Block a user