diff options
| author | Alexandr Kondrashov <[email protected]> | 2015-09-11 16:43:00 +0300 |
|---|---|---|
| committer | Alexandr Kondrashov <[email protected]> | 2015-09-11 16:43:00 +0300 |
| commit | c9725926b2f30bed4e37f57c20ef8ffeb2fd233b (patch) | |
| tree | 2964ad7556549dd3e0712bdfdbc5fc4ae7a9b45f /js/tests/unit/tooltip.js | |
| parent | 353e0a49a97c24d89f6cdb95014419d4137dee6e (diff) | |
| parent | b811f8cf9628dbcbfe994f71588c5a0c921a092d (diff) | |
| download | bootstrap-c9725926b2f30bed4e37f57c20ef8ffeb2fd233b.tar.xz bootstrap-c9725926b2f30bed4e37f57c20ef8ffeb2fd233b.zip | |
Merge remote-tracking branch 'twbs/v4-dev' into patch-1
Conflicts:
scss/_custom-forms.scss
scss/_variables.scss
Diffstat (limited to 'js/tests/unit/tooltip.js')
| -rw-r--r-- | js/tests/unit/tooltip.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index f4deb29f8..934e26b9e 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -119,6 +119,35 @@ $(function () { assert.strictEqual($tooltip.data('bs.tooltip').tip.parentNode, null, 'tooltip removed') }) + QUnit.test('should allow DOMElement title (html: false)', function (assert) { + assert.expect(3) + var title = document.createTextNode('<3 writing tests') + var $tooltip = $('<a href="#" rel="tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ title: title }) + + $tooltip.bootstrapTooltip('show') + + assert.notEqual($('.tooltip').length, 0, 'tooltip inserted') + assert.strictEqual($('.tooltip').text(), '<3 writing tests', 'title inserted') + assert.ok(!$.contains($('.tooltip').get(0), title), 'title node copied, not moved') + }) + + QUnit.test('should allow DOMElement title (html: true)', function (assert) { + assert.expect(3) + var title = document.createTextNode('<3 writing tests') + var $tooltip = $('<a href="#" rel="tooltip"/>') + .appendTo('#qunit-fixture') + .bootstrapTooltip({ html: true, title: title }) + + $tooltip.bootstrapTooltip('show') + + assert.notEqual($('.tooltip').length, 0, 'tooltip inserted') + assert.strictEqual($('.tooltip').text(), '<3 writing tests', 'title inserted') + assert.ok($.contains($('.tooltip').get(0), title), 'title node moved, not copied') + }) + + QUnit.test('should respect custom classes', function (assert) { assert.expect(2) var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') |
