fix(tooltip): remove dependency on lion-button

This commit is contained in:
Thomas Allmer 2020-01-30 14:16:55 +01:00
parent 41f5af71ca
commit 8889413ca4
2 changed files with 5 additions and 6 deletions

View file

@ -1,5 +1,4 @@
import { expect, fixture, html } from '@open-wc/testing'; import { expect, fixture, html } from '@open-wc/testing';
import '../../button/lion-button.js';
import '../lion-tooltip-arrow.js'; import '../lion-tooltip-arrow.js';
import '../lion-tooltip.js'; import '../lion-tooltip.js';
@ -7,7 +6,7 @@ describe('lion-tooltip-arrow', () => {
it('has a visual "arrow" element inside the content node', async () => { it('has a visual "arrow" element inside the content node', async () => {
const el = await fixture(html` const el = await fixture(html`
<lion-tooltip opened> <lion-tooltip opened>
<lion-button slot="invoker">Tooltip button</lion-button> <button slot="invoker">Tooltip button</button>
<div slot="content">Hey there</div> <div slot="content">Hey there</div>
<lion-tooltip-arrow slot="arrow"></lion-tooltip-arrow> <lion-tooltip-arrow slot="arrow"></lion-tooltip-arrow>
</lion-tooltip> </lion-tooltip>
@ -21,7 +20,7 @@ describe('lion-tooltip-arrow', () => {
it('reflects popper placement in its own placement property and attribute', async () => { it('reflects popper placement in its own placement property and attribute', async () => {
const el = await fixture(html` const el = await fixture(html`
<lion-tooltip .config=${{ popperConfig: { placement: 'right' } }}> <lion-tooltip .config=${{ popperConfig: { placement: 'right' } }}>
<lion-button slot="invoker">Tooltip button</lion-button> <button slot="invoker">Tooltip button</button>
<div slot="content">Hey there</div> <div slot="content">Hey there</div>
<lion-tooltip-arrow slot="arrow"></lion-tooltip-arrow> <lion-tooltip-arrow slot="arrow"></lion-tooltip-arrow>
</lion-tooltip> </lion-tooltip>
@ -55,7 +54,7 @@ describe('lion-tooltip-arrow', () => {
<div slot="content" style="height: 30px; background-color: red;"> <div slot="content" style="height: 30px; background-color: red;">
Hey there Hey there
</div> </div>
<lion-button slot="invoker">Tooltip button</lion-button> <button slot="invoker" style="height: 30px;">Tooltip button</button>
<lion-tooltip-arrow slot="arrow"></lion-tooltip-arrow> <lion-tooltip-arrow slot="arrow"></lion-tooltip-arrow>
</lion-tooltip> </lion-tooltip>
`); `);

View file

@ -159,7 +159,7 @@ describe('lion-tooltip', () => {
const el = await fixture(html` const el = await fixture(html`
<lion-tooltip> <lion-tooltip>
<div slot="content">Hey there</div> <div slot="content">Hey there</div>
<lion-button slot="invoker">Tooltip button</lion-button> <button slot="invoker">Tooltip button</button>
</lion-tooltip> </lion-tooltip>
`); `);
await expect(el).to.be.accessible; await expect(el).to.be.accessible;
@ -169,7 +169,7 @@ describe('lion-tooltip', () => {
const el = await fixture(html` const el = await fixture(html`
<lion-tooltip> <lion-tooltip>
<div slot="content">Hey there</div> <div slot="content">Hey there</div>
<lion-button slot="invoker">Tooltip button</lion-button> <button slot="invoker">Tooltip button</button>
</lion-tooltip> </lion-tooltip>
`); `);
const invoker = el.querySelector('[slot="invoker"]'); const invoker = el.querySelector('[slot="invoker"]');