aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/button.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2018-04-10 09:28:29 +0200
committerGitHub <[email protected]>2018-04-10 09:28:29 +0200
commit0871d69ec975b51472a451ed63ffa2af874606d2 (patch)
tree977e0bcbcde804c5a90da0fc28db41a6748b8b82 /js/tests/unit/button.js
parent875ed0b975a587fffcc1b0c632e1cc8f612ebc5a (diff)
downloadbootstrap-0871d69ec975b51472a451ed63ffa2af874606d2.tar.xz
bootstrap-0871d69ec975b51472a451ed63ffa2af874606d2.zip
v4 improve coverage (#25945)
* Improve code coverage for our Button plugin * improve coverage for our Alert plugin * test tooltip update method * test update and dispose for dropdown * increase code coverage requirements
Diffstat (limited to 'js/tests/unit/button.js')
-rw-r--r--js/tests/unit/button.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js
index cc2719c3a..1fdcce95f 100644
--- a/js/tests/unit/button.js
+++ b/js/tests/unit/button.js
@@ -172,4 +172,27 @@ $(function () {
assert.ok($btn.is(':not(.active)'), 'button did not become active')
assert.ok(!$input.is(':checked'), 'checkbox did not get checked')
})
+
+ QUnit.test('dispose should remove data and the element', function (assert) {
+ assert.expect(2)
+
+ var $el = $('<div/>')
+ var $button = $el.bootstrapButton()
+
+ assert.ok(typeof $button.data('bs.button') !== 'undefined')
+
+ $button.data('bs.button').dispose()
+
+ assert.ok(typeof $button.data('bs.button') === 'undefined')
+ })
+
+ QUnit.test('should return button version', function (assert) {
+ assert.expect(1)
+
+ if (typeof Button !== 'undefined') {
+ assert.ok(typeof Button.VERSION === 'string')
+ } else {
+ assert.notOk()
+ }
+ })
})