From ae623ee39c68f49e157f34f829782c82aaefd357 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Tue, 18 Mar 2025 16:46:41 +0100 Subject: [PATCH] Add failing test --- .../renderers/svelte/src/public-types.test.ts | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/code/renderers/svelte/src/public-types.test.ts b/code/renderers/svelte/src/public-types.test.ts index ff55d048acb..aa6157b5749 100644 --- a/code/renderers/svelte/src/public-types.test.ts +++ b/code/renderers/svelte/src/public-types.test.ts @@ -1,11 +1,17 @@ +/* eslint-disable @typescript-eslint/no-shadow */ // this file tests Typescript types that's why there are no assertions import { describe, it } from 'vitest'; import { satisfies } from 'storybook/internal/common'; -import type { Canvas, ComponentAnnotations, StoryAnnotations } from 'storybook/internal/types'; +import type { + Args, + Canvas, + ComponentAnnotations, + StoryAnnotations, +} from 'storybook/internal/types'; import { expectTypeOf } from 'expect-type'; -import { SvelteComponent, type Component, type ComponentProps } from 'svelte'; +import { type Component, type ComponentProps, SvelteComponent } from 'svelte'; import Button from './__test__/Button.svelte'; import ButtonV5 from './__test__/ButtonV5.svelte'; @@ -315,3 +321,15 @@ it('mount accepts a Svelte 5 Component and props', () => { }; expectTypeOf(Basic).toMatchTypeOf>(); }); + +it('StoryObj can accept args directly', () => { + const Story: StoryObj = { + args: {}, + }; + + const Story2: StoryObj<{ args: { prop: boolean } }> = { + args: { + prop: true, + }, + }; +});