aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorfat <[email protected]>2015-05-07 17:07:38 -0700
committerfat <[email protected]>2015-05-07 17:14:38 -0700
commit660505188241418ffda53b5eb848defecd5f57e1 (patch)
treeec0895cb5267cc798f386f96caca653a7fe191f1 /js/tests
parentc3a79b1a8c2fa8d7fc8edcd3e626dad8b45d5dc3 (diff)
downloadbootstrap-660505188241418ffda53b5eb848defecd5f57e1.tar.xz
bootstrap-660505188241418ffda53b5eb848defecd5f57e1.zip
button -> es6
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/index.html2
-rw-r--r--js/tests/unit/button.js58
-rw-r--r--js/tests/visual/button.html8
3 files changed, 3 insertions, 65 deletions
diff --git a/js/tests/index.html b/js/tests/index.html
index 536e34c74..29c84e2cc 100644
--- a/js/tests/index.html
+++ b/js/tests/index.html
@@ -132,9 +132,9 @@
<!-- es6 Plugin sources -->
<script src="../../js/dist/util.js"></script>
<script src="../../js/dist/alert.js"></script>
+ <script src="../../js/dist/button.js"></script>
<!-- Old Plugin sources -->
- <script src="../../js/button.js"></script>
<script src="../../js/carousel.js"></script>
<script src="../../js/collapse.js"></script>
<script src="../../js/dropdown.js"></script>
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js
index 691796c42..5648506cf 100644
--- a/js/tests/unit/button.js
+++ b/js/tests/unit/button.js
@@ -32,64 +32,6 @@ $(function () {
assert.strictEqual($button[0], $el[0], 'collection contains element')
})
- QUnit.test('should return set state to loading', function (assert) {
- assert.expect(4)
- var $btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
- assert.strictEqual($btn.html(), 'mdo', 'btn text equals mdo')
- $btn.bootstrapButton('loading')
- var done = assert.async()
- setTimeout(function () {
- assert.strictEqual($btn.html(), 'fat', 'btn text equals fat')
- assert.ok($btn[0].hasAttribute('disabled'), 'btn is disabled')
- assert.ok($btn.hasClass('disabled'), 'btn has disabled class')
- done()
- }, 0)
- })
-
- QUnit.test('should return reset state', function (assert) {
- assert.expect(7)
- var $btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
- assert.strictEqual($btn.html(), 'mdo', 'btn text equals mdo')
- $btn.bootstrapButton('loading')
- var doneOne = assert.async()
- setTimeout(function () {
- assert.strictEqual($btn.html(), 'fat', 'btn text equals fat')
- assert.ok($btn[0].hasAttribute('disabled'), 'btn is disabled')
- assert.ok($btn.hasClass('disabled'), 'btn has disabled class')
- doneOne()
- var doneTwo = assert.async()
- $btn.bootstrapButton('reset')
- setTimeout(function () {
- assert.strictEqual($btn.html(), 'mdo', 'btn text equals mdo')
- assert.ok(!$btn[0].hasAttribute('disabled'), 'btn is not disabled')
- assert.ok(!$btn.hasClass('disabled'), 'btn does not have disabled class')
- doneTwo()
- }, 0)
- }, 0)
- })
-
- QUnit.test('should work with an empty string as reset state', function (assert) {
- assert.expect(7)
- var $btn = $('<button class="btn" data-loading-text="fat"/>')
- assert.strictEqual($btn.html(), '', 'btn text equals ""')
- $btn.bootstrapButton('loading')
- var doneOne = assert.async()
- setTimeout(function () {
- assert.strictEqual($btn.html(), 'fat', 'btn text equals fat')
- assert.ok($btn[0].hasAttribute('disabled'), 'btn is disabled')
- assert.ok($btn.hasClass('disabled'), 'btn has disabled class')
- doneOne()
- var doneTwo = assert.async()
- $btn.bootstrapButton('reset')
- setTimeout(function () {
- assert.strictEqual($btn.html(), '', 'btn text equals ""')
- assert.ok(!$btn[0].hasAttribute('disabled'), 'btn is not disabled')
- assert.ok(!$btn.hasClass('disabled'), 'btn does not have disabled class')
- doneTwo()
- }, 0)
- }, 0)
- })
-
QUnit.test('should toggle active', function (assert) {
assert.expect(2)
var $btn = $('<button class="btn" data-toggle="button">mdo</button>')
diff --git a/js/tests/visual/button.html b/js/tests/visual/button.html
index d92a08329..a6eed7e05 100644
--- a/js/tests/visual/button.html
+++ b/js/tests/visual/button.html
@@ -22,10 +22,6 @@
<h1>Button <small>Bootstrap Visual Test</small></h1>
</div>
- <button type="button" data-loading-text="Loading for 3 seconds..." class="btn btn-primary js-loading-button">
- Loading state
- </button>
-
<button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button>
<div class="btn-group" data-toggle="buttons">
@@ -56,8 +52,8 @@
<!-- JavaScript Includes -->
<script src="../vendor/jquery.min.js"></script>
-<script src="../../transition.js"></script>
-<script src="../../button.js"></script>
+<script src="../../dist/util.js"></script>
+<script src="../../dist/button.js"></script>
<!-- JavaScript Test -->
<script>