mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 08:34:08 +02:00
button -> es6
This commit is contained in:
@@ -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>
|
||||
|
@@ -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>')
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user