diff options
| author | Jacob <[email protected]> | 2014-03-24 22:42:40 -0400 |
|---|---|---|
| committer | Jacob <[email protected]> | 2014-03-24 22:42:40 -0400 |
| commit | b3421cf040c92d50ec709a7ed761eb6ce9057e5b (patch) | |
| tree | a390c15e1a5084f650a619c3ad7b5d4902883846 /js/tests | |
| parent | bc250fb1e7c289ea07b9bcd117d9093021b16f46 (diff) | |
| parent | 674b41dd632d4911d291a593a23a5563a1a67811 (diff) | |
| download | bootstrap-b3421cf040c92d50ec709a7ed761eb6ce9057e5b.tar.xz bootstrap-b3421cf040c92d50ec709a7ed761eb6ce9057e5b.zip | |
Merge pull request #13165 from stefanneculai/master
Fix popover when using append
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/popover.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js index c08b6d8ef..24f2f6f03 100644 --- a/js/tests/unit/popover.js +++ b/js/tests/unit/popover.js @@ -61,6 +61,35 @@ $(function () { $('#qunit-fixture').empty() }) + test('should not duplicate HTML object', function () { + $.support.transition = false + + $div = $('<div>').html('loves writing tests (╯°□°)╯︵ ┻━┻') + + var popover = $('<a href="#">@fat</a>') + .appendTo('#qunit-fixture') + .popover({ + content: function () { + return $div + } + }) + + popover.popover('show') + ok($('.popover').length, 'popover was inserted') + equal($('.popover .popover-content').html(), $div, 'content correctly inserted') + + popover.popover('hide') + ok(!$('.popover').length, 'popover was removed') + + popover.popover('show') + ok($('.popover').length, 'popover was inserted') + equal($('.popover .popover-content').html(), $div, 'content correctly inserted') + + popover.popover('hide') + ok(!$('.popover').length, 'popover was removed') + $('#qunit-fixture').empty() + }) + test('should get title and content from attributes', function () { $.support.transition = false var popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>') |
