`);
await aTimeout();
const initialPopperModifiers = el._overlayCtrl.config.popperConfig.modifiers;
expect(el._overlayCtrl.config.popperConfig.placement).to.equal('top');
// TODO: this fails in CI, we need to investigate why in CI
// the value of the transform is: translate3d(16px, -26px, 0px)'
// expect(el.querySelector('[slot=_overlay-shadow-outlet]').style.transform).to.equal(
// 'translate3d(15px, -26px, 0px)',
// );
el.config = {
popperConfig: {
placement: 'bottom',
},
};
el.opened = false;
el.opened = true;
await aTimeout();
const updatedPopperModifiers = el._overlayCtrl.config.popperConfig.modifiers;
expect(updatedPopperModifiers).to.deep.equal(initialPopperModifiers);
expect(el._overlayCtrl.config.popperConfig.placement).to.equal('bottom');
// TODO: this fails in CI, we need to investigate why in CI
// the value of the transform is: translate3d(16px, 26px, 0px)'
// expect(el.querySelector('[slot=_overlay-shadow-outlet]').style.transform).to.equal(
// 'translate3d(15px, 26px, 0px)',
// );
});
});
describe('Accessibility', () => {
it('should have a tooltip role set on the tooltip', async () => {
const el = await fixture(html`
Hey there
`);
// FIXME: This should be refactored to Array.from(this.children).find(child => child.slot === 'content')
// When this issue is fixed https://github.com/ing-bank/lion/issues/382
const content = el.querySelector('[slot=content]');
expect(content.getAttribute('role')).to.be.equal('tooltip');
});
it('should be accessible when closed', async () => {
const el = await fixture(html`
Hey there
Tooltip button
`);
await expect(el).to.be.accessible;
});
it('should be accessible when opened', async () => {
const el = await fixture(html`