`,
@@ -411,7 +398,7 @@ storiesOf('Overlay System | Overlay as a WC', module)
}}
>UK
-
+
United Kingdom
@@ -475,13 +462,13 @@ storiesOf('Overlay System | Overlay as a WC', module)
: { popperConfig: { placement: text('local config', 'top-start') } }),
}}
>
-
Overlay
-
+
Overlay
+
Hello! You can close this notification here:
- e.target.dispatchEvent(new Event('demo-overlay-close', { bubbles: true }))}
- >⨯ e.target.dispatchEvent(new Event('hide', { bubbles: true }))}
+ >⨯
diff --git a/packages/overlays/stories/overlay-features.stories.js b/packages/overlays/stories/overlay-features.stories.js
index fd9a7d9f2..b6108c402 100644
--- a/packages/overlays/stories/overlay-features.stories.js
+++ b/packages/overlays/stories/overlay-features.stories.js
@@ -233,7 +233,7 @@ storiesOf('Overlay System | Behavior Features', module)
${this.options[(this.options.indexOf(this.placement) + 1) % this.options.length]}
position
-
this.dispatchEvent(new CustomEvent('close'))}">Close
+
this.dispatchEvent(new Event('hide'))}">Close
`;
}
@@ -265,9 +265,6 @@ storiesOf('Overlay System | Behavior Features', module)
element.addEventListener('toggle-placement', e => {
overlayCtrl.updateConfig({ viewportConfig: { placement: e.detail } });
});
- element.addEventListener('close', () => {
- overlayCtrl.hide();
- });
return html`
- Tooltip
+ Tooltip
Hello there!
@@ -67,19 +65,19 @@ storiesOf('Overlays Specific WC|Tooltip', module)
- Top
+ Top
Its top placement
- Right
+ Right
Its right placement
- Bottom
+ Bottom
Its bottom placement
- Left
+ Left
Its left placement
@@ -119,7 +117,7 @@ storiesOf('Overlays Specific WC|Tooltip', module)
}),
}}"
>
-
${text('Invoker text', 'Hover me!')}
+
${text('Invoker text', 'Hover me!')}
${text('Content text', 'Hello, World!')}
diff --git a/packages/tooltip/test/lion-tooltip.test.js b/packages/tooltip/test/lion-tooltip.test.js
index 45d64bddc..5d61bd42f 100644
--- a/packages/tooltip/test/lion-tooltip.test.js
+++ b/packages/tooltip/test/lion-tooltip.test.js
@@ -1,24 +1,26 @@
-import { expect, fixture, html } from '@open-wc/testing';
+import { expect, fixture, html, unsafeStatic } from '@open-wc/testing';
+import { runOverlayMixinSuite } from '@lion/overlays/test-suites/OverlayMixin.suite.js';
import '../lion-tooltip.js';
describe('lion-tooltip', () => {
- describe('Basic', () => {
- it('should not be shown by default', async () => {
- const el = await fixture(html`
-
- Hey there
- Tooltip button
-
- `);
- expect(el._overlayCtrl.isShown).to.equal(false);
- });
+ describe('Integration tests', () => {
+ const tagString = 'lion-tooltip';
+ const tag = unsafeStatic(tagString);
+ runOverlayMixinSuite({
+ tagString,
+ tag,
+ suffix: ' for lion-tooltip',
+ });
+ });
+
+ describe('Basic', () => {
it('should show content on mouseenter and hide on mouseleave', async () => {
const el = await fixture(html`
Hey there
- Tooltip button
+ Tooltip button
`);
const eventMouseEnter = new Event('mouseenter');
@@ -35,7 +37,7 @@ describe('lion-tooltip', () => {
const el = await fixture(html`
Hey there
- Tooltip button
+ Tooltip button
`);
const eventMouseEnter = new Event('mouseenter');
@@ -52,7 +54,7 @@ describe('lion-tooltip', () => {
const el = await fixture(html`
Hey there
- Tooltip button
+ Tooltip button
`);
const invoker = Array.from(el.children).find(child => child.slot === 'invoker');
@@ -70,7 +72,7 @@ describe('lion-tooltip', () => {
const el = await fixture(html`
Hey there
- Tooltip button
+ Tooltip button
`);
const invoker = Array.from(el.children).find(child => child.slot === 'invoker');
@@ -90,7 +92,7 @@ describe('lion-tooltip', () => {
This is Tooltip using overlay
-
Tooltip button
+
Tooltip button
`);
const invoker = Array.from(el.children).find(child => child.slot === 'invoker');
@@ -106,7 +108,7 @@ describe('lion-tooltip', () => {
const el = await fixture(html`
Hey there
- Tooltip button
+ Tooltip button
`);
diff --git a/yarn.lock b/yarn.lock
index 84580045d..7cfb81f99 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2088,7 +2088,7 @@
wallaby-webpack "^3.0.0"
webpack "^4.28.0"
-"@open-wc/testing@^2.3.4", "@open-wc/testing@^2.3.9":
+"@open-wc/testing@^2.3.4":
version "2.3.9"
resolved "https://registry.yarnpkg.com/@open-wc/testing/-/testing-2.3.9.tgz#048bb3122d989cf0df96611513aaec7738964e3d"
integrity sha512-5pKtHNP/73y9VWAwXOdxf4uzKVAtCowSdy4B6It4iETq8RshkAtKJbJBj+iQSU81pG6jOgSNPlGYeU01/CXaxw==