mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-26 23:54:23 +01:00
fix(tooltip): remove useless unit test
This commit is contained in:
parent
0338b61eb6
commit
f2aab5ea99
@ -523,46 +523,6 @@ $(function () {
|
|||||||
assert.ok(passed, '.tooltip(\'show\') should not throw an error if element no longer is in dom')
|
assert.ok(passed, '.tooltip(\'show\') should not throw an error if element no longer is in dom')
|
||||||
})
|
})
|
||||||
|
|
||||||
QUnit.test('should place tooltip on top of element', function (assert) {
|
|
||||||
assert.expect(1)
|
|
||||||
var done = assert.async()
|
|
||||||
|
|
||||||
var containerHTML = '<div id="test">' +
|
|
||||||
'<p style="margin-top: 200px">' +
|
|
||||||
'<a href="#" title="very very very very very very very long tooltip">Hover me</a>' +
|
|
||||||
'</p>' +
|
|
||||||
'</div>'
|
|
||||||
|
|
||||||
var $container = $(containerHTML)
|
|
||||||
.css({
|
|
||||||
position: 'absolute',
|
|
||||||
bottom: 0,
|
|
||||||
left: 0,
|
|
||||||
textAlign: 'right',
|
|
||||||
width: 300,
|
|
||||||
height: 300
|
|
||||||
})
|
|
||||||
.appendTo('#qunit-fixture')
|
|
||||||
|
|
||||||
$container
|
|
||||||
.find('a')
|
|
||||||
.css('margin-top', 200)
|
|
||||||
.bootstrapTooltip({
|
|
||||||
placement: 'top',
|
|
||||||
animate: false
|
|
||||||
})
|
|
||||||
.on('shown.bs.tooltip', function () {
|
|
||||||
var $tooltip = $($(this).data('bs.tooltip').tip)
|
|
||||||
if (/iPhone|iPad|iPod/.test(navigator.userAgent)) {
|
|
||||||
assert.ok(Math.round($tooltip.offset().top + $tooltip.outerHeight()) <= Math.round($(this).offset().top))
|
|
||||||
} else {
|
|
||||||
assert.ok(Math.round($tooltip.offset().top + $tooltip.outerHeight()) >= Math.round($(this).offset().top))
|
|
||||||
}
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
.bootstrapTooltip('show')
|
|
||||||
})
|
|
||||||
|
|
||||||
QUnit.test('should show tooltip if leave event hasn\'t occurred before delay expires', function (assert) {
|
QUnit.test('should show tooltip if leave event hasn\'t occurred before delay expires', function (assert) {
|
||||||
assert.expect(2)
|
assert.expect(2)
|
||||||
var done = assert.async()
|
var done = assert.async()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user