From b56d97f21065037523ec17f45685916df8aca678 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 20 Jan 2015 19:40:50 -0800 Subject: update JS unit tests to future-proof QUnit 1.16.0 API [skip validator] --- js/tests/unit/button.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'js/tests/unit/button.js') 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 = $('') 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 = $('') 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 = $('