mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
test(grid): add unit tests
This commit is contained in:
parent
f7ac0e3f22
commit
d45409c7f3
5 changed files with 181 additions and 36 deletions
44
tests/Grid/Grid.test.svelte
Normal file
44
tests/Grid/Grid.test.svelte
Normal file
|
@ -0,0 +1,44 @@
|
|||
<script lang="ts">
|
||||
import { Grid } from "carbon-components-svelte";
|
||||
|
||||
export let condensed = false;
|
||||
export let narrow = false;
|
||||
export let fullWidth = false;
|
||||
export let noGutter = false;
|
||||
export let noGutterLeft = false;
|
||||
export let noGutterRight = false;
|
||||
export let padding = false;
|
||||
export let as = false;
|
||||
</script>
|
||||
|
||||
{#if as}
|
||||
<Grid
|
||||
{as}
|
||||
{condensed}
|
||||
{narrow}
|
||||
{fullWidth}
|
||||
{noGutter}
|
||||
{noGutterLeft}
|
||||
{noGutterRight}
|
||||
{padding}
|
||||
{...$$restProps}
|
||||
let:props
|
||||
>
|
||||
<header {...props}>
|
||||
<slot />
|
||||
</header>
|
||||
</Grid>
|
||||
{:else}
|
||||
<Grid
|
||||
{condensed}
|
||||
{narrow}
|
||||
{fullWidth}
|
||||
{noGutter}
|
||||
{noGutterLeft}
|
||||
{noGutterRight}
|
||||
{padding}
|
||||
{...$$restProps}
|
||||
>
|
||||
<slot />
|
||||
</Grid>
|
||||
{/if}
|
Loading…
Add table
Add a link
Reference in a new issue