fixes #1653
This commit is contained in:
parent
4110f00f31
commit
5b195795da
5 changed files with 38 additions and 43 deletions
|
@ -20,8 +20,6 @@
|
|||
<div id="tooltip" hidden>Tooltip</div>
|
||||
|
||||
<script>
|
||||
// for the demo
|
||||
setTimeout(function() {
|
||||
new HoverIntent({
|
||||
elem,
|
||||
over() {
|
||||
|
@ -33,7 +31,6 @@
|
|||
tooltip.hidden = true;
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -49,18 +49,18 @@ describe("hoverIntent", function() {
|
|||
}
|
||||
})
|
||||
|
||||
it("mouseover -> immediately no tooltip", function() {
|
||||
it("mouseover -> when the pointer just arrived, no tooltip", function() {
|
||||
mouse('mouseover', 10, 10);
|
||||
assert.isFalse(isOver);
|
||||
});
|
||||
|
||||
it("mouseover -> pause shows tooltip", function() {
|
||||
it("mouseover -> after a delay, the tooltip shows up", function() {
|
||||
mouse('mouseover', 10, 10);
|
||||
this.clock.tick(100);
|
||||
assert.isTrue(isOver);
|
||||
});
|
||||
|
||||
it("mouseover -> fast mouseout no tooltip", function() {
|
||||
it("mouseover -> followed by fast mouseout leads doesn't show tooltip", function() {
|
||||
mouse('mouseover', 10, 10);
|
||||
setTimeout(
|
||||
() => mouse('mouseout', 300, 300, { relatedTarget: document.body}),
|
||||
|
|
|
@ -45,6 +45,7 @@ class HoverIntent {
|
|||
|
||||
destroy() {
|
||||
/* your code to "disable" the functionality, remove all handlers */
|
||||
/* it's needed for the tests to work */
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
<div id="tooltip" hidden>Tooltip</div>
|
||||
|
||||
<script>
|
||||
// for the demo
|
||||
setTimeout(function() {
|
||||
new HoverIntent({
|
||||
elem,
|
||||
over() {
|
||||
|
@ -33,7 +31,6 @@
|
|||
tooltip.hidden = true;
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -49,18 +49,18 @@ describe("hoverIntent", function() {
|
|||
}
|
||||
})
|
||||
|
||||
it("mouseover -> immediately no tooltip", function() {
|
||||
it("mouseover -> when the pointer just arrived, no tooltip", function() {
|
||||
mouse('mouseover', 10, 10);
|
||||
assert.isFalse(isOver);
|
||||
});
|
||||
|
||||
it("mouseover -> pause shows tooltip", function() {
|
||||
it("mouseover -> after a delay, the tooltip shows up", function() {
|
||||
mouse('mouseover', 10, 10);
|
||||
this.clock.tick(100);
|
||||
assert.isTrue(isOver);
|
||||
});
|
||||
|
||||
it("mouseover -> fast mouseout no tooltip", function() {
|
||||
it("mouseover -> followed by fast mouseout leads doesn't show tooltip", function() {
|
||||
mouse('mouseover', 10, 10);
|
||||
setTimeout(
|
||||
() => mouse('mouseout', 300, 300, { relatedTarget: document.body}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue