Skip to content

Instantly share code, notes, and snippets.

@childnode
Created May 3, 2013 11:27
Show Gist options
  • Save childnode/5508590 to your computer and use it in GitHub Desktop.
Save childnode/5508590 to your computer and use it in GitHub Desktop.
test("reposition arrow test", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 100px;"></a>')
.appendTo('#qunit-fixture')
.tooltip({
placement: 'bottom'
})
.tooltip('show')
equal($('.tooltip').children('.tooltip-arrow').length, 1, '.tooltip-arrow is present')
equal($('.tooltip').children('.tooltip-arrow').position().left, '50%', '.tooltip-arrow positioned in the middle')
tooltip.tooltip('hide')
ok(!$(".tooltip").length, 'tooltip removed')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment