-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from appwrite/tooltip
feat: created tooltip component and test
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script lang="ts"> | ||
export let icon = 'info'; | ||
export let aria = 'info'; | ||
</script> | ||
|
||
<button class="tooltip" aria-label={aria}> | ||
<span class={`icon-${icon}`} aria-hidden="true" /> | ||
<span class="tooltip-popup" role="tooltip"> | ||
<slot /> | ||
</span> | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import '@testing-library/jest-dom'; | ||
import { render } from '@testing-library/svelte'; | ||
import { Tooltip } from '../../../src/lib/components'; | ||
|
||
test('shows tooltip', () => { | ||
const { getByRole } = render(Tooltip); | ||
|
||
expect(getByRole('tooltip')).toBeInTheDocument(); | ||
}); |
1cd3dfd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
svelte-console – ./
svelte-console-appwrite.vercel.app
svelte-console-git-main-appwrite.vercel.app
brand-new-console.torsten.appwrite.org
svelte-console.vercel.app