2
0
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:
Chris Rebert
2015-01-20 19:40:50 -08:00
parent a8139a0392
commit b56d97f210
11 changed files with 226 additions and 226 deletions
+9 -9
View File
@@ -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()