From 54e66ce89a39a4c93d1abc117bc68a6dd62ccf11 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Thu, 16 May 2024 16:47:12 +0200 Subject: [PATCH] fix getStoryContext type --- src/playwright/hooks.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/playwright/hooks.ts b/src/playwright/hooks.ts index f2032dab..851bd9c1 100644 --- a/src/playwright/hooks.ts +++ b/src/playwright/hooks.ts @@ -1,5 +1,5 @@ import type { BrowserContext, Page } from 'playwright'; -import type { StoryContext } from '@storybook/csf'; +import type { StoryContextForEnhancers } from '@storybook/csf'; export type TestContext = { id: string; @@ -73,7 +73,10 @@ export const setPostVisit = (postVisit: TestHook) => { globalThis.__sbPostVisit = postVisit; }; -export const getStoryContext = async (page: Page, context: TestContext): Promise => { +export const getStoryContext = async ( + page: Page, + context: TestContext +): Promise => { return page.evaluate(({ storyId }) => globalThis.__getContext(storyId), { storyId: context.id, });