Commit 0bc458df authored by William Oliveira's avatar William Oliveira
Browse files

Creating asynchronous tests for loading buttons, because they have setTimeout() function

parent 52171316
1 merge request!1024Buttons Tests
Showing with 12 additions and 4 deletions
+12 -4
......@@ -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')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment