@@ -16,6 +16,7 @@ exports[`Capital letters in story names converted into delimiters 1`] = `
16
16
\\" locStart\\ " : 8 ,
17
17
\\" locEnd\\ " : 10 ,
18
18
\\" filePath\\ " : \\" tests/fixtures/capitalization.stories.tsx\\ " ,
19
+ \\" namedExport\\ " : \\" BigBarkingDog\\ " ,
19
20
\\" meta\\ " : {}
20
21
},
21
22
\\" capitalization--blue-tiny-cat\\ " : {
@@ -26,6 +27,7 @@ exports[`Capital letters in story names converted into delimiters 1`] = `
26
27
\\" locStart\\ " : 4 ,
27
28
\\" locEnd\\ " : 6 ,
28
29
\\" filePath\\ " : \\" tests/fixtures/capitalization.stories.tsx\\ " ,
30
+ \\" namedExport\\ " : \\" BlueTinyCat\\ " ,
29
31
\\" meta\\ " : {}
30
32
}
31
33
}
@@ -48,6 +50,7 @@ exports[`Capital letters in the filename converted into delimiters 1`] = `
48
50
\\" locStart\\ " : 4 ,
49
51
\\" locEnd\\ " : 6 ,
50
52
\\" filePath\\ " : \\" tests/fixtures/filenameCapitalization.stories.tsx\\ " ,
53
+ \\" namedExport\\ " : \\" Test\\ " ,
51
54
\\" meta\\ " : {}
52
55
}
53
56
}
@@ -70,6 +73,7 @@ exports[`Default title is used instead of the file name 1`] = `
70
73
\\" locStart\\ " : 8 ,
71
74
\\" locEnd\\ " : 10 ,
72
75
\\" filePath\\ " : \\" tests/fixtures/default-title.stories.tsx\\ " ,
76
+ \\" namedExport\\ " : \\" Cat\\ " ,
73
77
\\" meta\\ " : {}
74
78
}
75
79
}
@@ -92,6 +96,7 @@ exports[`Extract and merge story meta 1`] = `
92
96
\\" locStart\\ " : 14 ,
93
97
\\" locEnd\\ " : 16 ,
94
98
\\" filePath\\ " : \\" tests/fixtures/story-meta.stories.tsx\\ " ,
99
+ \\" namedExport\\ " : \\" Cat\\ " ,
95
100
\\" meta\\ " : {
96
101
\\" baseweb\\ " : {
97
102
\\" theme\\ " : \\" dark\\ " ,
@@ -112,6 +117,7 @@ exports[`Extract and merge story meta 1`] = `
112
117
\\" locStart\\ " : 26 ,
113
118
\\" locEnd\\ " : 28 ,
114
119
\\" filePath\\ " : \\" tests/fixtures/story-meta.stories.tsx\\ " ,
120
+ \\" namedExport\\ " : \\" Dog\\ " ,
115
121
\\" meta\\ " : {
116
122
\\" baseweb\\ " : {
117
123
\\" theme\\ " : \\" dark\\ " ,
@@ -142,6 +148,7 @@ exports[`Extract default meta 1`] = `
142
148
\\" locStart\\ " : 13 ,
143
149
\\" locEnd\\ " : 15 ,
144
150
\\" filePath\\ " : \\" tests/fixtures/default-meta.stories.tsx\\ " ,
151
+ \\" namedExport\\ " : \\" Cat\\ " ,
145
152
\\" meta\\ " : {
146
153
\\" baseweb\\ " : {
147
154
\\" foo\\ " : \\" title\\ "
@@ -168,6 +175,7 @@ exports[`Single file with two stories 1`] = `
168
175
\\" locStart\\ " : 4 ,
169
176
\\" locEnd\\ " : 6 ,
170
177
\\" filePath\\ " : \\" tests/fixtures/animals.stories.tsx\\ " ,
178
+ \\" namedExport\\ " : \\" Cat\\ " ,
171
179
\\" meta\\ " : {}
172
180
},
173
181
\\" animals--dog\\ " : {
@@ -178,6 +186,7 @@ exports[`Single file with two stories 1`] = `
178
186
\\" locStart\\ " : 8 ,
179
187
\\" locEnd\\ " : 10 ,
180
188
\\" filePath\\ " : \\" tests/fixtures/animals.stories.tsx\\ " ,
189
+ \\" namedExport\\ " : \\" Dog\\ " ,
181
190
\\" meta\\ " : {}
182
191
}
183
192
}
@@ -200,6 +209,7 @@ exports[`Story name replaces named export as a story name 1`] = `
200
209
\\" locStart\\ " : 15 ,
201
210
\\" locEnd\\ " : 17 ,
202
211
\\" filePath\\ " : \\" tests/fixtures/storyname.stories.tsx\\ " ,
212
+ \\" namedExport\\ " : \\" CapitalCity\\ " ,
203
213
\\" meta\\ " : {}
204
214
},
205
215
\\" storyname--champs-élysées\\ " : {
@@ -210,6 +220,7 @@ exports[`Story name replaces named export as a story name 1`] = `
210
220
\\" locStart\\ " : 19 ,
211
221
\\" locEnd\\ " : 21 ,
212
222
\\" filePath\\ " : \\" tests/fixtures/storyname.stories.tsx\\ " ,
223
+ \\" namedExport\\ " : \\" CapitalReplaced\\ " ,
213
224
\\" meta\\ " : {}
214
225
},
215
226
\\" storyname--doggo\\ " : {
@@ -220,12 +231,98 @@ exports[`Story name replaces named export as a story name 1`] = `
220
231
\\" locStart\\ " : 4 ,
221
232
\\" locEnd\\ " : 9 ,
222
233
\\" filePath\\ " : \\" tests/fixtures/storyname.stories.tsx\\ " ,
234
+ \\" namedExport\\ " : \\" Cat\\ " ,
223
235
\\" meta\\ " : {}
224
236
}
225
237
}
226
238
} "
227
239
` ;
228
240
241
+ exports [` Test multiple stories 1` ] = `
242
+ {
243
+ " about" : {
244
+ " github" : " https://github.com/tajo/ladle" ,
245
+ " homepage" : " https://www.ladle.dev" ,
246
+ " version" : 1 ,
247
+ },
248
+ " stories" : {
249
+ " storyname--capital-city" : {
250
+ " filePath" : " tests/fixtures/storyname.stories.tsx" ,
251
+ " levels" : [
252
+ " Storyname" ,
253
+ ],
254
+ " locEnd" : 17 ,
255
+ " locStart" : 15 ,
256
+ " meta" : {},
257
+ " name" : " Capital city" ,
258
+ " namedExport" : " CapitalCity" ,
259
+ },
260
+ " storyname--champs-élysées" : {
261
+ " filePath" : " tests/fixtures/storyname.stories.tsx" ,
262
+ " levels" : [
263
+ " Storyname" ,
264
+ ],
265
+ " locEnd" : 21 ,
266
+ " locStart" : 19 ,
267
+ " meta" : {},
268
+ " name" : " Champs élysées" ,
269
+ " namedExport" : " CapitalReplaced" ,
270
+ },
271
+ " storyname--doggo" : {
272
+ " filePath" : " tests/fixtures/storyname.stories.tsx" ,
273
+ " levels" : [
274
+ " Storyname" ,
275
+ ],
276
+ " locEnd" : 9 ,
277
+ " locStart" : 4 ,
278
+ " meta" : {},
279
+ " name" : " Doggo" ,
280
+ " namedExport" : " Cat" ,
281
+ },
282
+ " title--cat" : {
283
+ " filePath" : " tests/fixtures/story-meta.stories.tsx" ,
284
+ " levels" : [
285
+ " Title" ,
286
+ ],
287
+ " locEnd" : 16 ,
288
+ " locStart" : 14 ,
289
+ " meta" : {
290
+ " baseweb" : {
291
+ " browsers" : [
292
+ " chrome" ,
293
+ " firefox" ,
294
+ ],
295
+ " theme" : " dark" ,
296
+ " width" : " 500px" ,
297
+ },
298
+ " links" : true ,
299
+ },
300
+ " name" : " Cat" ,
301
+ " namedExport" : " Cat" ,
302
+ },
303
+ " title--dog" : {
304
+ " filePath" : " tests/fixtures/story-meta.stories.tsx" ,
305
+ " levels" : [
306
+ " Title" ,
307
+ ],
308
+ " locEnd" : 28 ,
309
+ " locStart" : 26 ,
310
+ " meta" : {
311
+ " baseweb" : {
312
+ " browsers" : [
313
+ " chrome" ,
314
+ " webkit" ,
315
+ ],
316
+ " theme" : " dark" ,
317
+ },
318
+ },
319
+ " name" : " Dog" ,
320
+ " namedExport" : " Dog" ,
321
+ },
322
+ },
323
+ }
324
+ ` ;
325
+
229
326
exports [` Turn file name delimiters into spaces and levels correctly 1` ] = `
230
327
"{
231
328
\\" about\\ " : {
@@ -243,6 +340,7 @@ exports[`Turn file name delimiters into spaces and levels correctly 1`] = `
243
340
\\" locStart\\ " : 4 ,
244
341
\\" locEnd\\ " : 6 ,
245
342
\\" filePath\\ " : \\" tests/fixtures/our-animals--mammals.stories.tsx\\ " ,
343
+ \\" namedExport\\ " : \\" Cat\\ " ,
246
344
\\" meta\\ " : {}
247
345
}
248
346
}
0 commit comments