aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/button.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2018-06-07 22:21:31 +0200
committerXhmikosR <[email protected]>2019-02-20 22:05:45 +0200
commit9313446274edbb216fd7777c3d3f3147622e81e7 (patch)
tree00bd8a3540ad83c2843359f9b68c064866f76c42 /js/tests/unit/button.js
parent2b780787797da2bed2af0f95963be61e2b8e94a4 (diff)
downloadbootstrap-9313446274edbb216fd7777c3d3f3147622e81e7.tar.xz
bootstrap-9313446274edbb216fd7777c3d3f3147622e81e7.zip
fix(event-handler): remove the use of our event handler in unit test
Diffstat (limited to 'js/tests/unit/button.js')
-rw-r--r--js/tests/unit/button.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js
index 50b531f6f..e116730c2 100644
--- a/js/tests/unit/button.js
+++ b/js/tests/unit/button.js
@@ -125,25 +125,26 @@ $(function () {
var $btn1 = $group.children().eq(0)
var $btn2 = $group.children().eq(1)
+ var inputBtn2 = $btn2.find('input')[0]
assert.ok($btn1.hasClass('active'), 'btn1 has active class')
assert.ok($btn1.find('input').prop('checked'), 'btn1 is checked')
assert.ok(!$btn2.hasClass('active'), 'btn2 does not have active class')
- assert.ok(!Manipulator.isChecked($btn2.find('input')[0]), 'btn2 is not checked')
+ assert.ok(!(inputBtn2.bsChecked || inputBtn2.checked), 'btn2 is not checked')
- EventHandler.trigger($btn2.find('input')[0], 'click')
+ inputBtn2.dispatchEvent(new Event('click'))
assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class')
assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked')
assert.ok($btn2.hasClass('active'), 'btn2 has active class')
- assert.ok(Manipulator.isChecked($btn2.find('input')[0]), 'btn2 is checked')
+ assert.ok(inputBtn2.bsChecked || inputBtn2.checked, 'btn2 is checked')
- EventHandler.trigger($btn2.find('input')[0], 'click') // clicking an already checked radio should not un-check it
+ inputBtn2.dispatchEvent(new Event('click')) // clicking an already checked radio should not un-check it
assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class')
assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked')
assert.ok($btn2.hasClass('active'), 'btn2 has active class')
- assert.ok(Manipulator.isChecked($btn2.find('input')[0]), 'btn2 is checked')
+ assert.ok(inputBtn2.bsChecked || inputBtn2.checked, 'btn2 is checked')
})
QUnit.test('should only toggle selectable inputs', function (assert) {