diff options
| author | Chris Rebert <[email protected]> | 2015-01-20 19:40:50 -0800 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2015-01-20 19:57:51 -0800 |
| commit | b56d97f21065037523ec17f45685916df8aca678 (patch) | |
| tree | b519beaf24b689866298bba284234e812db9ad53 /js/tests/unit/button.js | |
| parent | a8139a03921541a7b66f97a0cbbdd1f5a597bdb8 (diff) | |
| download | bootstrap-b56d97f21065037523ec17f45685916df8aca678.tar.xz bootstrap-b56d97f21065037523ec17f45685916df8aca678.zip | |
update JS unit tests to future-proof QUnit 1.16.0 API
[skip validator]
Diffstat (limited to 'js/tests/unit/button.js')
| -rw-r--r-- | js/tests/unit/button.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 320996483..cb51d40b9 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -29,57 +29,57 @@ $(function () { strictEqual($button[0], $el[0], 'collection contains element') }) - test('should return set state to loading', function () { + 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') - stop() + 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') - start() + done() }, 0) }) - test('should return reset state', function () { + 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') - stop() + 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') - start() - stop() + 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') - start() + doneTwo() }, 0) }, 0) }) - test('should work with an empty string as reset state', function () { + 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') - stop() + 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') - start() - stop() + 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') - start() + doneTwo() }, 0) }, 0) }) |
