From 0871d69ec975b51472a451ed63ffa2af874606d2 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Tue, 10 Apr 2018 09:28:29 +0200 Subject: 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 --- js/tests/unit/button.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'js/tests/unit/button.js') 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 = $('
') + 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() + } + }) }) -- cgit v1.2.3