diff --git a/packages/bee-q/src/components/tooltip/__tests__/bq-tooltip.e2e.ts b/packages/bee-q/src/components/tooltip/__tests__/bq-tooltip.e2e.ts
index 7f8f15640..daf8b31af 100644
--- a/packages/bee-q/src/components/tooltip/__tests__/bq-tooltip.e2e.ts
+++ b/packages/bee-q/src/components/tooltip/__tests__/bq-tooltip.e2e.ts
@@ -7,16 +7,16 @@ describe('bq-tooltip', () => {
const page = await newE2EPage();
await page.setContent('');
- const element = await page.find('bq-tooltip');
- expect(element).toHaveClass('hydrated');
+ const tooltipElem = await page.find('bq-tooltip');
+ expect(tooltipElem).toHaveClass('hydrated');
});
it('should have shadow root', async () => {
const page = await newE2EPage();
await page.setContent('');
- const element = await page.find('bq-tooltip');
- expect(element.shadowRoot).not.toBeNull();
+ const tooltipElem = await page.find('bq-tooltip');
+ expect(tooltipElem.shadowRoot).not.toBeNull();
});
it('should be visible on hover', async () => {
@@ -24,72 +24,64 @@ describe('bq-tooltip', () => {
await page.setContent(`
Yuhu! A tooltip!
-
- Hover me!
-
+ Hover me!
`);
- const element = await page.find('bq-tooltip >>> [part="panel"]');
- expect(element).toHaveAttribute('aria-hidden');
+ const tooltipPanel = await page.find('bq-tooltip >>> [part="panel"]');
+ expect(tooltipPanel).toHaveAttribute('aria-hidden');
const button = await page.find('bq-button');
await button.hover();
- expect(element).not.toHaveAttribute('aria-hidden');
+ expect(tooltipPanel).not.toHaveAttribute('aria-hidden');
});
it('should hide on mouse out', async () => {
const page = await newE2EPage();
- await page.setContent(`
-
another element
-
- Yuhu! A tooltip!
-
- Hover me!
-
+ await page.setContent(`
+
+ Yuhu! A tooltip!
+ Hover me!
- `);
+ `);
- const element = await page.find('bq-tooltip >>> [part="panel"]');
- expect(element).toHaveAttribute('aria-hidden');
+ const tooltipPanel = await page.find('bq-tooltip >>> [part="panel"]');
+ expect(tooltipPanel).not.toHaveAttribute('aria-hidden');
- const button = await page.find('bq-button');
- await button.hover();
- expect(element).not.toHaveAttribute('aria-hidden');
+ await page.click('body');
+ await page.waitForChanges();
- const anotherEl = await page.find('div');
- await anotherEl.hover();
- expect(element).toHaveAttribute('aria-hidden');
+ expect(tooltipPanel).toHaveAttribute('aria-hidden');
});
it('should be visible only on click if specified', async () => {
const page = await newE2EPage();
- await page.setContent(`
+ await page.setContent(`
+
Yuhu! A tooltip!
-
- Hover me!
-
- `);
+ Hover me!
+
+ `);
- const element = await page.find('bq-tooltip >>> [part="panel"]');
- expect(element).toHaveAttribute('aria-hidden');
+ const tooltipPanel = await page.find('bq-tooltip >>> [part="panel"]');
+ expect(tooltipPanel).toHaveAttribute('aria-hidden');
const button = await page.find('bq-button');
await button.hover();
- expect(element).toHaveAttribute('aria-hidden');
+ expect(tooltipPanel).toHaveAttribute('aria-hidden');
await button.click();
- expect(element).not.toHaveAttribute('aria-hidden');
+ expect(tooltipPanel).not.toHaveAttribute('aria-hidden');
});
it('should show in specified position', async () => {
const page = await newE2EPage();
- await page.setContent(`
+ await page.setContent(`
+
Yuhu! A tooltip!
-
- Hover me!
-
- `);
+ Hover me!
+
+ `);
const button = await page.find('bq-button');
await button.hover();