`)
);
const arrowNode = /** @type {Element} */ (el._arrowNode);
expect(arrowNode.getAttribute('aria-hidden')).to.equal('true');
});
it('hides the arrow when has-arrow is false', async () => {
const el = /** @type {ArrowTest} */ (
await fixture(html`
This is a tooltip
`)
);
el.hasArrow = false;
await el.updateComplete;
expect(el.hasAttribute('has-arrow')).to.be.false;
const arrowNode = /** @type {Element} */ (el._arrowNode);
expect(window.getComputedStyle(arrowNode).getPropertyValue('display')).to.equal('none');
});
it('makes sure positioning of the arrow is correct', async () => {
const el = /** @type {ArrowTest} */ (
await fixture(html`
Hey there
`)
);
el.opened = true;
await el.repositionComplete;
expect(
getComputedStyle(/** @type {HTMLElement} */ (el._arrowNode)).getPropertyValue('left'),
).to.equal(
'-10px',
`
arrow height is 8px so this offset should be taken into account to align the arrow properly,
as well as half the difference between width and height ((12 - 8) / 2 = 2)
`,
);
});
});