@@ -14,14 +14,19 @@ describe("storybook/story-to-test", () => {
1414
1515 const storyTestFiles = await buildStoryTestFiles ( [ story ] , {
1616 autoScreenshots : true ,
17+ autoscreenshotSelector : "foobar" ,
1718 autoScreenshotStorybookGlobals : { } ,
1819 } ) ;
1920
2021 expect ( storyTestFiles ) . toEqual ( [ "/tmpdir/testplane-storybook-autogenerated/story/path/story.js.testplane.js" ] ) ;
2122 } ) ;
2223
2324 it ( "should empty tests dir before writing tests" , async ( ) => {
24- await buildStoryTestFiles ( [ ] , { autoScreenshots : true , autoScreenshotStorybookGlobals : { } } ) ;
25+ await buildStoryTestFiles ( [ ] , {
26+ autoScreenshots : true ,
27+ autoscreenshotSelector : "foobar" ,
28+ autoScreenshotStorybookGlobals : { } ,
29+ } ) ;
2530
2631 expect ( fs . emptyDir ) . toBeCalled ( ) ;
2732 } ) ;
@@ -30,22 +35,24 @@ describe("storybook/story-to-test", () => {
3035 jest . spyOn ( path , "resolve" ) . mockImplementation ( ( _ , storyPath ) => storyPath ) ;
3136 const storyFirst = { importPath : "./story/path/story-first.js" } as StorybookStoryExtended ;
3237 const storySecond = { importPath : "./story/path/story-second.js" } as StorybookStoryExtended ;
33-
34- const storyTestFiles = await buildStoryTestFiles ( [ storyFirst , storySecond ] , {
38+ const opts = {
3539 autoScreenshots : true ,
40+ autoscreenshotSelector : "foobar" ,
3641 autoScreenshotStorybookGlobals : { foo : { bar : "baz" } } ,
37- } ) ;
42+ } ;
43+
44+ const storyTestFiles = await buildStoryTestFiles ( [ storyFirst , storySecond ] , opts ) ;
3845
3946 expect ( writeStoryTestsFile ) . toBeCalledWith ( {
4047 testFile : "./story/path/story-first.js.testplane.js" ,
41- opts : { autoScreenshots : true , autoScreenshotStorybookGlobals : { foo : { bar : "baz" } } } ,
4248 stories : [ storyFirst ] ,
49+ opts,
4350 } ) ;
4451
4552 expect ( writeStoryTestsFile ) . toBeCalledWith ( {
4653 testFile : "./story/path/story-second.js.testplane.js" ,
47- opts : { autoScreenshots : true , autoScreenshotStorybookGlobals : { foo : { bar : "baz" } } } ,
4854 stories : [ storySecond ] ,
55+ opts,
4956 } ) ;
5057
5158 expect ( storyTestFiles ) . toEqual ( [
0 commit comments