Skip to content

Commit

Permalink
fix getStoryContext type
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed May 17, 2024
1 parent a038ece commit 54e66ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/playwright/hooks.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -73,7 +73,10 @@ export const setPostVisit = (postVisit: TestHook) => {
globalThis.__sbPostVisit = postVisit;
};

export const getStoryContext = async (page: Page, context: TestContext): Promise<StoryContext> => {
export const getStoryContext = async (
page: Page,
context: TestContext
): Promise<StoryContextForEnhancers> => {
return page.evaluate(({ storyId }) => globalThis.__getContext(storyId), {
storyId: context.id,
});
Expand Down

0 comments on commit 54e66ce

Please sign in to comment.