mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-26 23:54:23 +01:00
Creating asynchronous tests for loading buttons, because they have setTimeout() function
This commit is contained in:
parent
5217131657
commit
0bc458dfd2
16
js/tests/unit/bootstrap-buttons.js
vendored
16
js/tests/unit/bootstrap-buttons.js
vendored
@ -15,8 +15,12 @@ $(function () {
|
||||
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
||||
btn.button('loading')
|
||||
equals(btn.html(), 'fat', 'btn text equals fat')
|
||||
ok(btn.attr('disabled'), 'btn is disabled')
|
||||
ok(btn.hasClass('disabled'), 'btn has disabled class')
|
||||
stop()
|
||||
setTimeout(function() {
|
||||
start()
|
||||
ok(btn.attr('disabled'), 'btn is disabled')
|
||||
ok(btn.hasClass('disabled'), 'btn has disabled class')
|
||||
}, 0)
|
||||
})
|
||||
|
||||
test("should return reset state", function () {
|
||||
@ -24,8 +28,12 @@ $(function () {
|
||||
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
||||
btn.button('loading')
|
||||
equals(btn.html(), 'fat', 'btn text equals fat')
|
||||
ok(btn.attr('disabled'), 'btn is disabled')
|
||||
ok(btn.hasClass('disabled'), 'btn is disabled')
|
||||
stop()
|
||||
setTimeout(function() {
|
||||
start()
|
||||
ok(btn.attr('disabled'), 'btn is disabled')
|
||||
ok(btn.hasClass('disabled'), 'btn is disabled')
|
||||
}, 0)
|
||||
btn.button('reset')
|
||||
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
||||
ok(!btn.attr('disabled'), 'btn is not disabled')
|
||||
|
Loading…
x
Reference in New Issue
Block a user