mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
test(expandable-tile): add unit tests
This commit is contained in:
parent
ed8e2dc75b
commit
3ccd0ea56d
5 changed files with 263 additions and 22 deletions
31
tests/ExpandableTile/ExpandableTileCustom.test.svelte
Normal file
31
tests/ExpandableTile/ExpandableTileCustom.test.svelte
Normal file
|
@ -0,0 +1,31 @@
|
|||
<script lang="ts">
|
||||
import { ExpandableTile, Button } from "carbon-components-svelte";
|
||||
|
||||
export let buttonClicked = false;
|
||||
export let linkClicked = false;
|
||||
</script>
|
||||
|
||||
<ExpandableTile tileExpandedLabel="View less" tileCollapsedLabel="View more">
|
||||
<div slot="above">
|
||||
<a
|
||||
href="/"
|
||||
data-testid="test-link"
|
||||
on:click|preventDefault|stopPropagation={() => {
|
||||
linkClicked = true;
|
||||
}}
|
||||
>
|
||||
Test link
|
||||
</a>
|
||||
<br /><br />
|
||||
<Button
|
||||
data-testid="test-button"
|
||||
on:click={(e) => {
|
||||
e.stopPropagation();
|
||||
buttonClicked = true;
|
||||
}}
|
||||
>
|
||||
Test button
|
||||
</Button>
|
||||
</div>
|
||||
<div slot="below">Below the fold content here</div>
|
||||
</ExpandableTile>
|
Loading…
Add table
Add a link
Reference in a new issue