mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 19:01:05 +00:00
test(popover): add unit tests
This commit is contained in:
parent
8142c71307
commit
d25a85c825
3 changed files with 195 additions and 20 deletions
41
tests/Popover/Popover.test.svelte
Normal file
41
tests/Popover/Popover.test.svelte
Normal file
|
@ -0,0 +1,41 @@
|
|||
<script lang="ts">
|
||||
import { Popover } from "carbon-components-svelte";
|
||||
|
||||
export let open = false;
|
||||
export let align:
|
||||
| "top"
|
||||
| "top-left"
|
||||
| "top-right"
|
||||
| "bottom"
|
||||
| "bottom-left"
|
||||
| "bottom-right"
|
||||
| "left"
|
||||
| "left-bottom"
|
||||
| "left-top"
|
||||
| "right"
|
||||
| "right-bottom"
|
||||
| "right-top" = "top";
|
||||
export let caret = false;
|
||||
export let light = false;
|
||||
export let highContrast = false;
|
||||
export let relative = false;
|
||||
export let closeOnOutsideClick = false;
|
||||
</script>
|
||||
|
||||
<div data-testid="parent">
|
||||
Parent
|
||||
<Popover
|
||||
{open}
|
||||
{closeOnOutsideClick}
|
||||
{align}
|
||||
{caret}
|
||||
{light}
|
||||
{highContrast}
|
||||
{relative}
|
||||
on:click:outside={(e) => {
|
||||
console.log("click:outside", e.detail);
|
||||
}}
|
||||
>
|
||||
<div data-testid="content">Content</div>
|
||||
</Popover>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue