mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 19:01:05 +00:00
test(breakpoint): add unit tests
This commit is contained in:
parent
b57c829e12
commit
4da835502e
5 changed files with 174 additions and 28 deletions
28
tests/Breakpoint/Breakpoint.test.svelte
Normal file
28
tests/Breakpoint/Breakpoint.test.svelte
Normal file
|
@ -0,0 +1,28 @@
|
|||
<script lang="ts">
|
||||
import { Breakpoint } from "carbon-components-svelte";
|
||||
import type { BreakpointSize } from "carbon-components-svelte/Breakpoint/breakpoints";
|
||||
|
||||
export let size: BreakpointSize | undefined = undefined;
|
||||
export let sizes: Record<BreakpointSize, boolean> = {
|
||||
sm: false,
|
||||
md: false,
|
||||
lg: false,
|
||||
xlg: false,
|
||||
max: false,
|
||||
};
|
||||
</script>
|
||||
|
||||
<Breakpoint
|
||||
bind:size
|
||||
bind:sizes
|
||||
on:change
|
||||
let:size={currentSize}
|
||||
let:sizes={currentSizes}
|
||||
>
|
||||
<div data-testid="current-size">{currentSize}</div>
|
||||
<div data-testid="is-sm">{currentSizes.sm}</div>
|
||||
<div data-testid="is-md">{currentSizes.md}</div>
|
||||
<div data-testid="is-lg">{currentSizes.lg}</div>
|
||||
<div data-testid="is-xlg">{currentSizes.xlg}</div>
|
||||
<div data-testid="is-max">{currentSizes.max}</div>
|
||||
</Breakpoint>
|
Loading…
Add table
Add a link
Reference in a new issue