mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(copy-button): add unit tests
This commit is contained in:
parent
e876553790
commit
9b3f2e0919
3 changed files with 95 additions and 11 deletions
26
tests/CopyButton/CopyButton.test.svelte
Normal file
26
tests/CopyButton/CopyButton.test.svelte
Normal file
|
@ -0,0 +1,26 @@
|
|||
<script lang="ts">
|
||||
import { CopyButton } from "carbon-components-svelte";
|
||||
</script>
|
||||
|
||||
<CopyButton
|
||||
text="text"
|
||||
iconDescription="Basic"
|
||||
on:copy={() => {
|
||||
console.log("copied");
|
||||
}}
|
||||
/>
|
||||
|
||||
<CopyButton
|
||||
iconDescription="Custom feedback"
|
||||
text="text"
|
||||
feedback="Copied to clipboard"
|
||||
feedbackTimeout={0}
|
||||
/>
|
||||
|
||||
<CopyButton
|
||||
text="Custom copy function"
|
||||
iconDescription="Custom copy function"
|
||||
copy={(text) => {
|
||||
console.log(`Custom copy: ${text}`);
|
||||
}}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue