diff options
| author | William Oliveira <[email protected]> | 2012-01-16 05:32:08 -0200 |
|---|---|---|
| committer | William Oliveira <[email protected]> | 2012-01-16 05:32:08 -0200 |
| commit | 0bc458dfd2931f9aa5a817734240b6e3797250a8 (patch) | |
| tree | adc5ac03d84eb20e4455bf1a4cf2de603d121348 | |
| parent | 5217131657afbb14bd497d21d72f5383756f0ed1 (diff) | |
| download | bootstrap-0bc458dfd2931f9aa5a817734240b6e3797250a8.tar.xz bootstrap-0bc458dfd2931f9aa5a817734240b6e3797250a8.zip | |
Creating asynchronous tests for loading buttons, because they have setTimeout() function
| -rw-r--r-- | js/tests/unit/bootstrap-buttons.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/js/tests/unit/bootstrap-buttons.js b/js/tests/unit/bootstrap-buttons.js index 9784f5222..9554bf2d4 100644 --- a/js/tests/unit/bootstrap-buttons.js +++ b/js/tests/unit/bootstrap-buttons.js @@ -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') |
