@@ -31,14 +31,25 @@ export const convertToFilePath = (url: string): string => {
3131 return normalizedPath . replace ( / % 2 0 / g, ' ' ) ;
3232} ;
3333
34- export const testStory = (
35- exportName : string ,
36- story : ComposedStoryFn | Story < Renderer > ,
37- meta : ComponentAnnotations | Meta < Renderer > ,
38- skipTags : string [ ] ,
39- storyId : string ,
40- testName ?: string
41- ) => {
34+ export const testStory = ( {
35+ exportName,
36+ story,
37+ meta,
38+ skipTags,
39+ storyId,
40+ componentPath,
41+ testName,
42+ componentName,
43+ } : {
44+ exportName : string ;
45+ story : ComposedStoryFn | Story < Renderer > ;
46+ meta : ComponentAnnotations | Meta < Renderer > ;
47+ skipTags : string [ ] ;
48+ storyId : string ;
49+ componentPath ?: string ;
50+ testName ?: string ;
51+ componentName ?: string ;
52+ } ) => {
4253 return async ( context : TestContext & { story : ComposedStoryFn } ) => {
4354 const annotations = getCsfFactoryAnnotations ( story , meta ) ;
4455
@@ -64,12 +75,19 @@ export const testStory = (
6475 context . story = composedStory ;
6576
6677 const _task = context . task as RunnerTask & {
67- meta : TaskMeta & { storyId : string ; reports : Report [ ] } ;
78+ meta : TaskMeta & {
79+ storyId : string ;
80+ reports : Report [ ] ;
81+ componentPath ?: string ;
82+ componentName ?: string ;
83+ } ;
6884 } ;
6985
7086 // The id will always be present, calculated by CsfFile
7187 // and is needed so that we can add the test to the story in Storybook's UI for the status
7288 _task . meta . storyId = storyId ;
89+ _task . meta . componentPath = componentPath ;
90+ _task . meta . componentName = componentName ;
7391
7492 await setViewport ( composedStory . parameters , composedStory . globals ) ;
7593
0 commit comments