mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 12:59:05 +02:00
bootstrap onto closure
This commit is contained in:
@@ -29,61 +29,6 @@ $(function () {
|
||||
strictEqual($button[0], $el[0], 'collection contains element')
|
||||
})
|
||||
|
||||
test('should return set state to loading', function (assert) {
|
||||
var $btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
||||
equal($btn.html(), 'mdo', 'btn text equals mdo')
|
||||
$btn.bootstrapButton('loading')
|
||||
var done = assert.async()
|
||||
setTimeout(function () {
|
||||
equal($btn.html(), 'fat', 'btn text equals fat')
|
||||
ok($btn[0].hasAttribute('disabled'), 'btn is disabled')
|
||||
ok($btn.hasClass('disabled'), 'btn has disabled class')
|
||||
done()
|
||||
}, 0)
|
||||
})
|
||||
|
||||
test('should return reset state', function (assert) {
|
||||
var $btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
||||
equal($btn.html(), 'mdo', 'btn text equals mdo')
|
||||
$btn.bootstrapButton('loading')
|
||||
var doneOne = assert.async()
|
||||
setTimeout(function () {
|
||||
equal($btn.html(), 'fat', 'btn text equals fat')
|
||||
ok($btn[0].hasAttribute('disabled'), 'btn is disabled')
|
||||
ok($btn.hasClass('disabled'), 'btn has disabled class')
|
||||
doneOne()
|
||||
var doneTwo = assert.async()
|
||||
$btn.bootstrapButton('reset')
|
||||
setTimeout(function () {
|
||||
equal($btn.html(), 'mdo', 'btn text equals mdo')
|
||||
ok(!$btn[0].hasAttribute('disabled'), 'btn is not disabled')
|
||||
ok(!$btn.hasClass('disabled'), 'btn does not have disabled class')
|
||||
doneTwo()
|
||||
}, 0)
|
||||
}, 0)
|
||||
})
|
||||
|
||||
test('should work with an empty string as reset state', function (assert) {
|
||||
var $btn = $('<button class="btn" data-loading-text="fat"/>')
|
||||
equal($btn.html(), '', 'btn text equals ""')
|
||||
$btn.bootstrapButton('loading')
|
||||
var doneOne = assert.async()
|
||||
setTimeout(function () {
|
||||
equal($btn.html(), 'fat', 'btn text equals fat')
|
||||
ok($btn[0].hasAttribute('disabled'), 'btn is disabled')
|
||||
ok($btn.hasClass('disabled'), 'btn has disabled class')
|
||||
doneOne()
|
||||
var doneTwo = assert.async()
|
||||
$btn.bootstrapButton('reset')
|
||||
setTimeout(function () {
|
||||
equal($btn.html(), '', 'btn text equals ""')
|
||||
ok(!$btn[0].hasAttribute('disabled'), 'btn is not disabled')
|
||||
ok(!$btn.hasClass('disabled'), 'btn does not have disabled class')
|
||||
doneTwo()
|
||||
}, 0)
|
||||
}, 0)
|
||||
})
|
||||
|
||||
test('should toggle active', function () {
|
||||
var $btn = $('<button class="btn" data-toggle="button">mdo</button>')
|
||||
ok(!$btn.hasClass('active'), 'btn does not have active class')
|
||||
|
Reference in New Issue
Block a user