Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Jul 3, 2024
1 parent 0c09887 commit d21d317
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions code/core/src/preview-api/modules/store/StoryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
normalizeProjectAnnotations,
prepareContext,
} from './csf';
import type { CleanupCallback } from '@storybook/csf';
import type { Canvas, CleanupCallback } from '@storybook/csf';
import type {
BoundStory,
CSFFile,
Expand Down Expand Up @@ -375,7 +375,7 @@ export class StoryStore<TRenderer extends Renderer> {
step: (label, play) => story.runStep(label, play, context),
context: null!,
mount: null!,
canvas: {},
canvas: {} as Canvas,
viewMode: 'story',
} as StoryContext<TRenderer>;

Expand Down
4 changes: 2 additions & 2 deletions code/renderers/svelte/src/public-types.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 { ComponentAnnotations, StoryAnnotations } from 'storybook/internal/types';
import type { Canvas, ComponentAnnotations, StoryAnnotations } from 'storybook/internal/types';
import { expectTypeOf } from 'expect-type';
import type { ComponentProps, SvelteComponent } from 'svelte';
import Button from './__test__/Button.svelte';
Expand Down Expand Up @@ -235,7 +235,7 @@ describe('Story args can be inferred', () => {
it('mount accepts a Component and props', () => {
const Basic: StoryObj<Button> = {
async play({ mount }) {
const canvas = await mount(Button, { label: 'label', disabled: true });
const canvas = await mount(Button, { props: { label: 'label', disabled: true } });
expectTypeOf(canvas).toEqualTypeOf<Canvas>();
},
};
Expand Down
2 changes: 1 addition & 1 deletion code/renderers/vue3/src/public-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ it('Infer type of slots', () => {
it('mount accepts a Component', () => {
const Basic: StoryObj<typeof Button> = {
async play({ mount }) {
const canvas = await mount(Button, { label: 'label', disabled: true });
const canvas = await mount(Button, { props: { label: 'label', disabled: true } });
expectTypeOf(canvas).toEqualTypeOf<Canvas>();
},
};
Expand Down

0 comments on commit d21d317

Please sign in to comment.