mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(pagination-nav): add unit tests
This commit is contained in:
parent
79d50b1a83
commit
6eda673aaf
3 changed files with 195 additions and 19 deletions
36
tests/PaginationNav/PaginationNav.test.svelte
Normal file
36
tests/PaginationNav/PaginationNav.test.svelte
Normal file
|
@ -0,0 +1,36 @@
|
|||
<script lang="ts">
|
||||
import { PaginationNav } from "carbon-components-svelte";
|
||||
|
||||
export let page = 1;
|
||||
export let total = 10;
|
||||
export let shown = 10;
|
||||
export let loop = false;
|
||||
export let forwardText = "Next page";
|
||||
export let backwardText = "Previous page";
|
||||
export let tooltipPosition:
|
||||
| "top"
|
||||
| "right"
|
||||
| "bottom"
|
||||
| "left"
|
||||
| "outside"
|
||||
| "inside" = "bottom";
|
||||
</script>
|
||||
|
||||
<PaginationNav
|
||||
bind:page
|
||||
{total}
|
||||
{shown}
|
||||
{loop}
|
||||
{forwardText}
|
||||
{backwardText}
|
||||
{tooltipPosition}
|
||||
on:change={(e) => {
|
||||
console.log("change", e.detail);
|
||||
}}
|
||||
on:click:button--previous={(e) => {
|
||||
console.log("previous", e.detail);
|
||||
}}
|
||||
on:click:button--next={(e) => {
|
||||
console.log("next", e.detail);
|
||||
}}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue