From d8ee1ba9b61ef4ba5b0494433e3a6eac414ef782 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Mon, 5 May 2014 12:11:59 +0200 Subject: Allow for resetText of a button to be a falsey value; fixes #13466 --- js/tests/unit/button.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'js/tests/unit/button.js') diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 10bff1442..da65ae383 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -57,7 +57,27 @@ $(function () { start() }, 0) }, 0) + }) + test('should work with an empty string as reset state', function () { + var btn = $('') + equal(btn.html(), '', 'btn text equals ""') + btn.bootstrapButton('loading') + equal(btn.html(), 'fat', 'btn text equals fat') + stop() + setTimeout(function () { + ok(btn.attr('disabled'), 'btn is disabled') + ok(btn.hasClass('disabled'), 'btn has disabled class') + start() + stop() + btn.bootstrapButton('reset') + equal(btn.html(), '', 'btn text equals ""') + setTimeout(function () { + ok(!btn.attr('disabled'), 'btn is not disabled') + ok(!btn.hasClass('disabled'), 'btn does not have disabled class') + start() + }, 0) + }, 0) }) test('should toggle active', function () { -- cgit v1.2.3