diff options
| author | Alexandr Kondrashov <[email protected]> | 2015-12-08 02:18:32 +0300 |
|---|---|---|
| committer | Alexandr Kondrashov <[email protected]> | 2015-12-08 02:18:32 +0300 |
| commit | 5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4 (patch) | |
| tree | 2951782d8d0aadb61dae9122d0f508a75ed8e7eb /js/tests/unit | |
| parent | c9725926b2f30bed4e37f57c20ef8ffeb2fd233b (diff) | |
| parent | afbaf4350560eaf2135fb0dc6dd761ebb746ac40 (diff) | |
| download | bootstrap-5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4.tar.xz bootstrap-5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4.zip | |
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into patch-1
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/carousel.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/collapse.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/dropdown.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/modal.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/popover.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/scrollspy.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/tab.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/tooltip.js | 12 |
8 files changed, 96 insertions, 0 deletions
diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js index 017bd9bee..d6d0186e1 100644 --- a/js/tests/unit/carousel.js +++ b/js/tests/unit/carousel.js @@ -24,6 +24,18 @@ $(function () { assert.strictEqual($.fn.carousel, undefined, 'carousel was set back to undefined (orig value)') }) + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div/>') + $el.bootstrapCarousel() + try { + $el.bootstrapCarousel('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/>') 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/>') diff --git a/js/tests/unit/dropdown.js b/js/tests/unit/dropdown.js index 566b50ee7..e6cda58d4 100644 --- a/js/tests/unit/dropdown.js +++ b/js/tests/unit/dropdown.js @@ -24,6 +24,18 @@ $(function () { assert.strictEqual($.fn.dropdown, undefined, 'dropdown 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.bootstrapDropdown() + try { + $el.bootstrapDropdown('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/>') diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 6da09e3c6..50baac8a3 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -24,6 +24,18 @@ $(function () { assert.strictEqual($.fn.modal, undefined, 'modal was set back to undefined (orig value)') }) + QUnit.test('should throw explicit error on undefined method', function (assert) { + assert.expect(1) + var $el = $('<div id="modal-test"/>') + $el.bootstrapModal() + try { + $el.bootstrapModal('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 id="modal-test"/>') diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js index 894468695..fcd7791d2 100644 --- a/js/tests/unit/popover.js +++ b/js/tests/unit/popover.js @@ -25,6 +25,18 @@ $(function () { assert.strictEqual($.fn.popover, undefined, 'popover 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.bootstrapPopover() + try { + $el.bootstrapPopover('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/>') diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js index 574422ef1..878c4d389 100644 --- a/js/tests/unit/scrollspy.js +++ b/js/tests/unit/scrollspy.js @@ -24,6 +24,18 @@ $(function () { assert.strictEqual($.fn.scrollspy, undefined, 'scrollspy 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.bootstrapScrollspy() + try { + $el.bootstrapScrollspy('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/>') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 1eed75e90..2e0143293 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -24,6 +24,18 @@ $(function () { assert.strictEqual($.fn.tab, undefined, 'tab 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.bootstrapTab() + try { + $el.bootstrapTab('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/>') diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 934e26b9e..9ec5ddb03 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -25,6 +25,18 @@ $(function () { assert.strictEqual($.fn.tooltip, undefined, 'tooltip 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.bootstrapTooltip() + try { + $el.bootstrapTooltip('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/>') |
