aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/button.js
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-03-06 04:34:28 -0800
committerChris Rebert <[email protected]>2015-03-09 01:05:43 -0700
commit725c6848c362f90bbdb931dcea70d40a1753d768 (patch)
tree9e17ecd543ff3cc5f1e3a7c7d30c9cf4faf49888 /js/tests/unit/button.js
parent21d56378e1f7ec1cd24ffefcad32357267930c74 (diff)
downloadbootstrap-725c6848c362f90bbdb931dcea70d40a1753d768.tar.xz
bootstrap-725c6848c362f90bbdb931dcea70d40a1753d768.zip
Disable jQuery event aliases when running test suite
To ensure that we don't accidentally use any of the aliases. This should prevent any future regressions from #12761. Also updates the test suite since it now can't use these aliases either.
Diffstat (limited to 'js/tests/unit/button.js')
-rw-r--r--js/tests/unit/button.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js
index 7788addd1..02312ebaf 100644
--- a/js/tests/unit/button.js
+++ b/js/tests/unit/button.js
@@ -106,7 +106,7 @@ $(function () {
.append($inner)
.appendTo('#qunit-fixture')
assert.ok(!$btn.hasClass('active'), 'btn does not have active class')
- $inner.click()
+ $inner.trigger('click')
assert.ok($btn.hasClass('active'), 'btn has class active')
})
@@ -126,7 +126,7 @@ $(function () {
.append($inner)
.appendTo('#qunit-fixture')
assert.strictEqual($btn.attr('aria-pressed'), 'false', 'btn aria-pressed state is false')
- $inner.click()
+ $inner.trigger('click')
assert.strictEqual($btn.attr('aria-pressed'), 'true', 'btn aria-pressed state is true')
})
@@ -139,7 +139,7 @@ $(function () {
.append($btn.append($inner))
.appendTo('#qunit-fixture')
assert.ok(!$btn.hasClass('active'), 'btn does not have active class')
- $inner.click()
+ $inner.trigger('click')
assert.ok($btn.hasClass('active'), 'btn has class active')
})
@@ -165,13 +165,13 @@ $(function () {
assert.ok($btn1.find('input').prop('checked'), 'btn1 is checked')
assert.ok(!$btn2.hasClass('active'), 'btn2 does not have active class')
assert.ok(!$btn2.find('input').prop('checked'), 'btn2 is not checked')
- $btn2.find('input').click()
+ $btn2.find('input').trigger('click')
assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class')
assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is checked')
assert.ok($btn2.hasClass('active'), 'btn2 has active class')
assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked')
- $btn2.find('input').click() // clicking an already checked radio should not un-check it
+ $btn2.find('input').trigger('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 checked')
assert.ok($btn2.hasClass('active'), 'btn2 has active class')