Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann-S committed Jan 11, 2018
1 parent 42b9114 commit 2a4d985
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions js/tests/unit/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ $(function () {
QUnit.test('Util.findShadowRoot should find the shadow DOM root', function (assert) {
// Only for newer browsers
if (typeof document.body.attachShadow !== 'function') {
assert.expect(0)
return
}

Expand Down
14 changes: 7 additions & 7 deletions js/tests/visual/tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ <h1>Tooltip <small>Bootstrap Visual Test</small></h1>
$(function () {
if (typeof document.body.attachShadow === 'function') {
var shadowRoot = $('#shadow')[0].attachShadow({ mode: 'open' })
shadowRoot.innerHTML = [
'<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top in a shadow dom">',
'Tooltip on top in a shadow dom',
'</button>',
'<button id="secondTooltip" type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top in a shadow dom with container option">',
'Tooltip on top in a shadow dom',
shadowRoot.innerHTML =
'<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top in a shadow dom">' +
' Tooltip on top in a shadow dom' +
'</button>' +
'<button id="secondTooltip" type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top in a shadow dom with container option">' +
' Tooltip on top in a shadow dom' +
'</button>'
].join('')

$(shadowRoot.firstChild).tooltip()
$(shadowRoot.getElementById('secondTooltip')).tooltip({
container: shadowRoot
Expand Down

0 comments on commit 2a4d985

Please sign in to comment.