diff options
| author | Chris Rebert <[email protected]> | 2015-01-21 13:00:12 -0800 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2015-01-21 13:00:12 -0800 |
| commit | 9238337cbbad3bc45fa036f5f1ed63dec86d2968 (patch) | |
| tree | a1fa418cb91eb698d97db9ed0745f86488383f99 /js/tests/unit/button.js | |
| parent | 9e0c4ff786217d585f427de5c7a3f87ac86f3648 (diff) | |
| parent | 1ce502dc4de0accf27a6c37c21d26f4739d09241 (diff) | |
| download | bootstrap-9238337cbbad3bc45fa036f5f1ed63dec86d2968.tar.xz bootstrap-9238337cbbad3bc45fa036f5f1ed63dec86d2968.zip | |
Merge branch 'master' into v4
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) }) |
