aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/collapse.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/collapse.js')
-rw-r--r--js/tests/unit/collapse.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js
index 78fafc6c2..4eadc205b 100644
--- a/js/tests/unit/collapse.js
+++ b/js/tests/unit/collapse.js
@@ -24,6 +24,18 @@ $(function () {
assert.strictEqual($.fn.collapse, undefined, 'collapse was set back to undefined (org value)')
})
+ QUnit.test('should throw explicit error on undefined method', function (assert) {
+ assert.expect(1)
+ var $el = $('<div/>')
+ $el.bootstrapCollapse()
+ try {
+ $el.bootstrapCollapse('noMethod')
+ }
+ catch (err) {
+ assert.strictEqual(err.message, 'No method named "noMethod"')
+ }
+ })
+
QUnit.test('should return jquery collection containing the element', function (assert) {
assert.expect(2)
var $el = $('<div/>')