Skip to content

Commit f38ece1

Browse files
authored
test(component): added spec to tooltip (#331)
Added spec to tooltip and fixed the documentation #310
1 parent 3a7a31b commit f38ece1

File tree

2 files changed

+23
-4
lines changed
  • apps/website/src/routes/docs/headless/(components)/tooltip
  • packages/kit-headless/src/components/tooltip

2 files changed

+23
-4
lines changed

apps/website/src/routes/docs/headless/(components)/tooltip/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
1010

1111
# Tooltip
1212

13-
#### A popup that displays information realted to an element when the element receives keyboard focus or the mouse hovers over it.
13+
#### A tooltip that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
1414

1515
<MainExample>
1616
```tsx
@@ -41,7 +41,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
4141

4242
## Examples
4343

44-
### EXAMPLE: Describing Unlabelled Icon Link
44+
### EXAMPLE: Describing Icon with Tooltip
4545

4646
<Example1>
4747
```tsx
@@ -72,7 +72,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
7272

7373
## API
7474

75-
### AccordionItem
75+
### Tooltip
7676

7777
<APITable
7878
propDescriptors={[
@@ -88,7 +88,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
8888
},
8989
{
9090
name: 'durationMs',
91-
type: 'nummber',
91+
type: 'number',
9292
description:
9393
'Sets a delay duration in milliseconds before the Tooltip is displayed.',
9494
},
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { Tooltip } from './tooltip';
3+
4+
const TooltipComponent = component$(() => {
5+
return <Tooltip content="tooltip message">Please hover me</Tooltip>;
6+
});
7+
8+
describe('Tooltip', () => {
9+
it('INIT', () => {
10+
cy.mount(<TooltipComponent />);
11+
12+
cy.checkA11yForComponent();
13+
});
14+
it('should render the component', () => {
15+
cy.mount(<TooltipComponent />);
16+
17+
cy.findByRole('tooltip').should('contain', 'tooltip message');
18+
});
19+
});

0 commit comments

Comments
 (0)