mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[vislib/tooltip] fix tests
This commit is contained in:
parent
d0694465b2
commit
edfaceea1f
2 changed files with 7 additions and 0 deletions
|
@ -128,6 +128,10 @@ define(function (require) {
|
|||
positionTooltip.getChartBounds = getChartBounds;
|
||||
positionTooltip.getViewportBounds = getViewportBounds;
|
||||
positionTooltip.placeToAvoidOverflow = placeToAvoidOverflow;
|
||||
positionTooltip.removeClone = function () {
|
||||
$clone && $clone.remove();
|
||||
$clone = null;
|
||||
};
|
||||
|
||||
return positionTooltip;
|
||||
});
|
|
@ -47,6 +47,7 @@ define(function (require) {
|
|||
afterEach(function () {
|
||||
$window.remove();
|
||||
$window = $chart = $tooltip = null;
|
||||
posTT.removeClone();
|
||||
});
|
||||
|
||||
function makeEvent(xPercent, yPercent) {
|
||||
|
@ -123,6 +124,8 @@ define(function (require) {
|
|||
// size the tooltip very small so it won't collide with the edges
|
||||
$tooltip.css({ width: 15, height: 15 });
|
||||
var size = posTT.getTtSize($tooltip);
|
||||
expect(size).to.have.property('width', 15);
|
||||
expect(size).to.have.property('height', 15);
|
||||
|
||||
// position the element based on a mouse that is in the middle of the chart
|
||||
var pos = posTT.getBasePosition(size, makeEvent(0.5, 0.5));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue