// box1: Can only fit below box1
info("Display the tooltip on box1.");
await showTooltip(tooltip, box1);
let expectedTooltipGeometry = { position: "bottom", height, width };
checkTooltipGeometry(tooltip, box1, expectedTooltipGeometry);
await hideTooltip(tooltip);
info("Try to display the tooltip on top of box1.");
await showTooltip(tooltip, box1, { position: "top" });
expectedTooltipGeometry = { position: "bottom", height, width };
checkTooltipGeometry(tooltip, box1, expectedTooltipGeometry);
await hideTooltip(tooltip);
// box2: Can fit above or below, will default to bottom, more height // available.
info("Try to display the tooltip on box2.");
await showTooltip(tooltip, box2);
expectedTooltipGeometry = { position: "bottom", height, width };
checkTooltipGeometry(tooltip, box2, expectedTooltipGeometry);
await hideTooltip(tooltip);
info("Try to display the tooltip on top of box2.");
await showTooltip(tooltip, box2, { position: "top" });
expectedTooltipGeometry = { position: "top", height, width };
checkTooltipGeometry(tooltip, box2, expectedTooltipGeometry);
await hideTooltip(tooltip);
// box3: Can fit above or below, will default to top, more height available.
info("Try to display the tooltip on box3.");
await showTooltip(tooltip, box3);
expectedTooltipGeometry = { position: "top", height, width };
checkTooltipGeometry(tooltip, box3, expectedTooltipGeometry);
await hideTooltip(tooltip);
info("Try to display the tooltip on bottom of box3.");
await showTooltip(tooltip, box3, { position: "bottom" });
expectedTooltipGeometry = { position: "bottom", height, width };
checkTooltipGeometry(tooltip, box3, expectedTooltipGeometry);
await hideTooltip(tooltip);
// box4: Can only fit above box4
info("Display the tooltip on box4.");
await showTooltip(tooltip, box4);
expectedTooltipGeometry = { position: "top", height, width };
checkTooltipGeometry(tooltip, box4, expectedTooltipGeometry);
await hideTooltip(tooltip);
info("Try to display the tooltip on bottom of box4.");
await showTooltip(tooltip, box4, { position: "bottom" });
expectedTooltipGeometry = { position: "top", height, width };
checkTooltipGeometry(tooltip, box4, expectedTooltipGeometry);
await hideTooltip(tooltip);
is(tooltip.isVisible(), false, "Tooltip is not visible");
tooltip.destroy();
});
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.