Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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 cc2719c3a0..1fdcce95fd 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()
+ }
+ })
})