@storybook/codemod 0.0.0-pr-23609-sha-f47ef339

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +262 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +1 -0
  4. package/dist/transforms/add-component-parameters.d.ts +22 -0
  5. package/dist/transforms/add-component-parameters.js +1 -0
  6. package/dist/transforms/csf-2-to-3.d.ts +8 -0
  7. package/dist/transforms/csf-2-to-3.js +3 -0
  8. package/dist/transforms/csf-hoist-story-annotations.d.ts +26 -0
  9. package/dist/transforms/csf-hoist-story-annotations.js +1 -0
  10. package/dist/transforms/mdx-to-csf.d.ts +7 -0
  11. package/dist/transforms/mdx-to-csf.js +61 -0
  12. package/dist/transforms/move-builtin-addons.d.ts +3 -0
  13. package/dist/transforms/move-builtin-addons.js +1 -0
  14. package/dist/transforms/storiesof-to-csf.d.ts +24 -0
  15. package/dist/transforms/storiesof-to-csf.js +1 -0
  16. package/dist/transforms/update-addon-info.d.ts +27 -0
  17. package/dist/transforms/update-addon-info.js +1 -0
  18. package/dist/transforms/update-organisation-name.d.ts +25 -0
  19. package/dist/transforms/update-organisation-name.js +1 -0
  20. package/dist/transforms/upgrade-deprecated-types.d.ts +10 -0
  21. package/dist/transforms/upgrade-deprecated-types.js +2 -0
  22. package/dist/transforms/upgrade-hierarchy-separators.d.ts +3 -0
  23. package/dist/transforms/upgrade-hierarchy-separators.js +1 -0
  24. package/jest.config.js +9 -0
  25. package/package.json +102 -0
  26. package/project.json +6 -0
  27. package/src/index.ts +103 -0
  28. package/src/lib/utils.test.js +9 -0
  29. package/src/lib/utils.ts +29 -0
  30. package/src/transforms/__testfixtures__/add-component-parameters/add-component-parameters.input.js +44 -0
  31. package/src/transforms/__testfixtures__/add-component-parameters/add-component-parameters.output.snapshot +68 -0
  32. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/basic.input.js +25 -0
  33. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/basic.output.snapshot +27 -0
  34. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/overrides.input.js +25 -0
  35. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/overrides.output.snapshot +28 -0
  36. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/variable.input.js +13 -0
  37. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/variable.output.snapshot +17 -0
  38. package/src/transforms/__testfixtures__/mdx-to-csf/basic.input.mdx +18 -0
  39. package/src/transforms/__testfixtures__/mdx-to-csf/basic.output.snapshot +40 -0
  40. package/src/transforms/__testfixtures__/mdx-to-csf/component-id.input.mdx +6 -0
  41. package/src/transforms/__testfixtures__/mdx-to-csf/component-id.output.snapshot +17 -0
  42. package/src/transforms/__testfixtures__/mdx-to-csf/decorators.input.mdx +8 -0
  43. package/src/transforms/__testfixtures__/mdx-to-csf/decorators.output.snapshot +18 -0
  44. package/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.input.mdx +19 -0
  45. package/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.output.snapshot +39 -0
  46. package/src/transforms/__testfixtures__/mdx-to-csf/parameters.input.mdx +14 -0
  47. package/src/transforms/__testfixtures__/mdx-to-csf/parameters.output.snapshot +23 -0
  48. package/src/transforms/__testfixtures__/mdx-to-csf/plaintext.input.mdx +3 -0
  49. package/src/transforms/__testfixtures__/mdx-to-csf/plaintext.output.snapshot +11 -0
  50. package/src/transforms/__testfixtures__/mdx-to-csf/story-function.input.mdx +10 -0
  51. package/src/transforms/__testfixtures__/mdx-to-csf/story-function.output.snapshot +18 -0
  52. package/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.input.mdx +18 -0
  53. package/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.output.snapshot +32 -0
  54. package/src/transforms/__testfixtures__/mdx-to-csf/story-refs.input.mdx +22 -0
  55. package/src/transforms/__testfixtures__/mdx-to-csf/story-refs.output.snapshot +34 -0
  56. package/src/transforms/__testfixtures__/move-builtin-addons/default.input.js +2 -0
  57. package/src/transforms/__testfixtures__/move-builtin-addons/default.output.snapshot +8 -0
  58. package/src/transforms/__testfixtures__/move-builtin-addons/with-no-change.input.js +3 -0
  59. package/src/transforms/__testfixtures__/move-builtin-addons/with-no-change.output.snapshot +7 -0
  60. package/src/transforms/__testfixtures__/storiesof-to-csf/basic.input.js +18 -0
  61. package/src/transforms/__testfixtures__/storiesof-to-csf/basic.output.snapshot +45 -0
  62. package/src/transforms/__testfixtures__/storiesof-to-csf/collision.input.js +11 -0
  63. package/src/transforms/__testfixtures__/storiesof-to-csf/collision.output.snapshot +38 -0
  64. package/src/transforms/__testfixtures__/storiesof-to-csf/const.input.js +1 -0
  65. package/src/transforms/__testfixtures__/storiesof-to-csf/const.output.snapshot +13 -0
  66. package/src/transforms/__testfixtures__/storiesof-to-csf/decorators.input.js +9 -0
  67. package/src/transforms/__testfixtures__/storiesof-to-csf/decorators.output.snapshot +18 -0
  68. package/src/transforms/__testfixtures__/storiesof-to-csf/default.input.js +7 -0
  69. package/src/transforms/__testfixtures__/storiesof-to-csf/default.output.snapshot +17 -0
  70. package/src/transforms/__testfixtures__/storiesof-to-csf/digit.input.js +1 -0
  71. package/src/transforms/__testfixtures__/storiesof-to-csf/digit.output.js +5 -0
  72. package/src/transforms/__testfixtures__/storiesof-to-csf/digit.output.snapshot +9 -0
  73. package/src/transforms/__testfixtures__/storiesof-to-csf/export-destructuring.input.js +11 -0
  74. package/src/transforms/__testfixtures__/storiesof-to-csf/export-destructuring.output.snapshot +23 -0
  75. package/src/transforms/__testfixtures__/storiesof-to-csf/export-function.input.js +12 -0
  76. package/src/transforms/__testfixtures__/storiesof-to-csf/export-function.output.snapshot +23 -0
  77. package/src/transforms/__testfixtures__/storiesof-to-csf/export-names.input.js +14 -0
  78. package/src/transforms/__testfixtures__/storiesof-to-csf/export-names.output.snapshot +26 -0
  79. package/src/transforms/__testfixtures__/storiesof-to-csf/exports.input.js +2 -0
  80. package/src/transforms/__testfixtures__/storiesof-to-csf/exports.output.snapshot +16 -0
  81. package/src/transforms/__testfixtures__/storiesof-to-csf/module.input.js +12 -0
  82. package/src/transforms/__testfixtures__/storiesof-to-csf/module.output.snapshot +16 -0
  83. package/src/transforms/__testfixtures__/storiesof-to-csf/multi.input.js +14 -0
  84. package/src/transforms/__testfixtures__/storiesof-to-csf/multi.output.snapshot +39 -0
  85. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters-as-var.input.js +8 -0
  86. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters-as-var.output.snapshot +20 -0
  87. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters.input.js +10 -0
  88. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters.output.snapshot +23 -0
  89. package/src/transforms/__testfixtures__/storiesof-to-csf/storiesof-var.input.js +11 -0
  90. package/src/transforms/__testfixtures__/storiesof-to-csf/storiesof-var.output.snapshot +23 -0
  91. package/src/transforms/__testfixtures__/storiesof-to-csf/story-decorators.input.js +11 -0
  92. package/src/transforms/__testfixtures__/storiesof-to-csf/story-decorators.output.snapshot +29 -0
  93. package/src/transforms/__testfixtures__/storiesof-to-csf/story-parameters.input.js +14 -0
  94. package/src/transforms/__testfixtures__/storiesof-to-csf/story-parameters.output.snapshot +32 -0
  95. package/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js +184 -0
  96. package/src/transforms/__testfixtures__/update-addon-info/update-addon-info.output.snapshot +184 -0
  97. package/src/transforms/__testfixtures__/update-organisation-name/update-organisation-name.input.js +19 -0
  98. package/src/transforms/__testfixtures__/update-organisation-name/update-organisation-name.output.snapshot +23 -0
  99. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/csf.input.js +3 -0
  100. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/csf.output.snapshot +7 -0
  101. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/dynamic-storiesof.input.js +5 -0
  102. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/dynamic-storiesof.output.snapshot +9 -0
  103. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/storiesof.input.js +8 -0
  104. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/storiesof.output.snapshot +12 -0
  105. package/src/transforms/__tests__/csf-2-to-3.test.ts +439 -0
  106. package/src/transforms/__tests__/mdx-to-csf.test.ts +628 -0
  107. package/src/transforms/__tests__/transforms.tests.js +32 -0
  108. package/src/transforms/__tests__/upgrade-deprecated-types.test.ts +170 -0
  109. package/src/transforms/add-component-parameters.js +62 -0
  110. package/src/transforms/csf-2-to-3.ts +336 -0
  111. package/src/transforms/csf-hoist-story-annotations.js +97 -0
  112. package/src/transforms/mdx-to-csf.ts +340 -0
  113. package/src/transforms/move-builtin-addons.js +32 -0
  114. package/src/transforms/storiesof-to-csf.js +277 -0
  115. package/src/transforms/update-addon-info.js +114 -0
  116. package/src/transforms/update-organisation-name.js +71 -0
  117. package/src/transforms/upgrade-deprecated-types.ts +142 -0
  118. package/src/transforms/upgrade-hierarchy-separators.js +39 -0
  119. package/tsconfig.json +10 -0
@@ -0,0 +1,439 @@
1
+ import { describe, it, expect } from '@jest/globals';
2
+ import { dedent } from 'ts-dedent';
3
+ import type { API } from 'jscodeshift';
4
+ import ansiRegex from 'ansi-regex';
5
+ import _transform from '../csf-2-to-3';
6
+
7
+ expect.addSnapshotSerializer({
8
+ print: (val: any) => val,
9
+ test: () => true,
10
+ });
11
+
12
+ const jsTransform = (source: string) =>
13
+ _transform({ source, path: 'Component.stories.js' }, {} as API, {}).trim();
14
+ const tsTransform = (source: string) =>
15
+ _transform({ source, path: 'Component.stories.ts' }, {} as API, { parser: 'tsx' }).trim();
16
+
17
+ describe('csf-2-to-3', () => {
18
+ describe('javascript', () => {
19
+ it('should replace non-simple function exports with objects', () => {
20
+ expect(
21
+ jsTransform(dedent`
22
+ export default { title: 'Cat' };
23
+ export const A = () => <Cat />;
24
+ export const B = (args) => <Button {...args} />;
25
+ `)
26
+ ).toMatchInlineSnapshot(`
27
+ export default { title: 'Cat' };
28
+ export const A = () => <Cat />;
29
+ export const B = {
30
+ render: (args) => <Button {...args} />,
31
+ };
32
+ `);
33
+ });
34
+
35
+ it('should move annotations into story objects', () => {
36
+ expect(
37
+ jsTransform(dedent`
38
+ export default { title: 'Cat' };
39
+
40
+ export const A = () => <Cat />;
41
+ A.storyName = 'foo';
42
+ A.parameters = { bar: 2 };
43
+ A.play = () => {};
44
+ `)
45
+ ).toMatchInlineSnapshot(`
46
+ export default { title: 'Cat' };
47
+
48
+ export const A = {
49
+ render: () => <Cat />,
50
+ name: 'foo',
51
+ parameters: { bar: 2 },
52
+ play: () => {},
53
+ };
54
+ `);
55
+ });
56
+
57
+ it('should ignore non-story exports, statements', () => {
58
+ expect(
59
+ jsTransform(dedent`
60
+ export default { title: 'components/Fruit', includeStories: ['A'] };
61
+
62
+ export const A = (args) => <Apple {...args} />;
63
+
64
+ export const B = (args) => <Banana {...args} />;
65
+
66
+ const C = (args) => <Cherry {...args} />;
67
+ `)
68
+ ).toMatchInlineSnapshot(`
69
+ export default { title: 'components/Fruit', includeStories: ['A'] };
70
+
71
+ export const A = {
72
+ render: (args) => <Apple {...args} />,
73
+ };
74
+
75
+ export const B = (args) => <Banana {...args} />;
76
+
77
+ const C = (args) => <Cherry {...args} />;
78
+ `);
79
+ });
80
+
81
+ it('should do nothing when there is no meta', () => {
82
+ expect(
83
+ jsTransform(dedent`
84
+ export const A = () => <Apple />;
85
+
86
+ export const B = (args) => <Banana {...args} />;
87
+ `)
88
+ ).toMatchInlineSnapshot(`
89
+ export const A = () => <Apple />;
90
+
91
+ export const B = (args) => <Banana {...args} />;
92
+ `);
93
+ });
94
+
95
+ it('should remove implicit global render function (react)', () => {
96
+ expect(
97
+ jsTransform(dedent`
98
+ export default { title: 'Cat', component: Cat };
99
+ export const A = (args) => <Cat {...args} />;
100
+ export const B = (args) => <Banana {...args} />;
101
+ `)
102
+ ).toMatchInlineSnapshot(`
103
+ export default { title: 'Cat', component: Cat };
104
+ export const A = {};
105
+ export const B = {
106
+ render: (args) => <Banana {...args} />,
107
+ };
108
+ `);
109
+ });
110
+
111
+ it('should ignore object exports', () => {
112
+ expect(
113
+ jsTransform(dedent`
114
+ export default { title: 'Cat', component: Cat };
115
+
116
+ export const A = {
117
+ render: (args) => <Cat {...args} />
118
+ };
119
+ `)
120
+ ).toMatchInlineSnapshot(`
121
+ export default { title: 'Cat', component: Cat };
122
+
123
+ export const A = {
124
+ render: (args) => <Cat {...args} />,
125
+ };
126
+ `);
127
+ });
128
+
129
+ it('should hoist template.bind (if there is only one)', () => {
130
+ expect(
131
+ jsTransform(dedent`
132
+ export default { title: 'Cat' };
133
+ const Template = (args) => <Cat {...args} />;
134
+ export const A = Template.bind({});
135
+ A.args = { isPrimary: false };
136
+ `)
137
+ ).toMatchInlineSnapshot(`
138
+ export default { title: 'Cat' };
139
+ const Template = (args) => <Cat {...args} />;
140
+
141
+ export const A = {
142
+ render: Template,
143
+ args: { isPrimary: false },
144
+ };
145
+ `);
146
+ });
147
+
148
+ it('should reuse the template when there are multiple Template.bind references but no component defined', () => {
149
+ expect(
150
+ jsTransform(dedent`
151
+ export default { title: 'Cat' };
152
+ const Template = (args) => <Cat {...args} />;
153
+
154
+ export const A = Template.bind({});
155
+ A.args = { isPrimary: false };
156
+
157
+ export const B = Template.bind({});
158
+ B.args = { isPrimary: true };
159
+
160
+
161
+ export const C = Template.bind({});
162
+ C.args = { bla: true };
163
+
164
+ export const D = Template.bind({});
165
+ D.args = { bla: false };
166
+ `)
167
+ ).toMatchInlineSnapshot(`
168
+ export default { title: 'Cat' };
169
+ const Template = (args) => <Cat {...args} />;
170
+
171
+ export const A = {
172
+ render: Template,
173
+ args: { isPrimary: false },
174
+ };
175
+
176
+ export const B = {
177
+ render: Template,
178
+ args: { isPrimary: true },
179
+ };
180
+
181
+ export const C = {
182
+ render: Template,
183
+ args: { bla: true },
184
+ };
185
+
186
+ export const D = {
187
+ render: Template,
188
+ args: { bla: false },
189
+ };
190
+ `);
191
+ });
192
+
193
+ it('should remove implicit global render for template.bind', () => {
194
+ expect(
195
+ jsTransform(dedent`
196
+ export default { title: 'Cat', component: Cat };
197
+
198
+ const Template = (args) => <Cat {...args} />;
199
+
200
+ export const A = Template.bind({});
201
+ A.args = { isPrimary: false };
202
+
203
+ const Template2 = (args) => <Banana {...args} />;
204
+
205
+ export const B = Template2.bind({});
206
+ B.args = { isPrimary: true };
207
+ `)
208
+ ).toMatchInlineSnapshot(`
209
+ export default { title: 'Cat', component: Cat };
210
+
211
+ export const A = {
212
+ args: { isPrimary: false },
213
+ };
214
+
215
+ const Template2 = (args) => <Banana {...args} />;
216
+
217
+ export const B = {
218
+ render: Template2,
219
+ args: { isPrimary: true },
220
+ };
221
+ `);
222
+ });
223
+
224
+ it('should ignore no-arg stories without annotations', () => {
225
+ expect(
226
+ jsTransform(dedent`
227
+ export default { title: 'Cat', component: Cat };
228
+
229
+ export const A = (args) => <Cat {...args} />;
230
+ export const B = () => <Cat name="frisky" />;
231
+ export const C = () => <Cat name="fluffy" />;
232
+ C.parameters = { foo: 2 };
233
+ `)
234
+ ).toMatchInlineSnapshot(`
235
+ export default { title: 'Cat', component: Cat };
236
+
237
+ export const A = {};
238
+ export const B = () => <Cat name="frisky" />;
239
+
240
+ export const C = {
241
+ render: () => <Cat name="fluffy" />,
242
+ parameters: { foo: 2 },
243
+ };
244
+ `);
245
+ });
246
+
247
+ it('should work for v1-style annotations', () => {
248
+ expect(
249
+ jsTransform(dedent`
250
+ export default { title: 'Cat' };
251
+ export const A = (args) => <Cat {...args} />;
252
+ A.story = {
253
+ parameters: { foo: 2 }
254
+ };
255
+ `)
256
+ ).toMatchInlineSnapshot(`
257
+ export default { title: 'Cat' };
258
+
259
+ export const A = {
260
+ render: (args) => <Cat {...args} />,
261
+ parameters: { foo: 2 },
262
+ };
263
+ `);
264
+ });
265
+ });
266
+
267
+ describe('typescript', () => {
268
+ it('should error with namespace imports', () => {
269
+ expect.addSnapshotSerializer({
270
+ serialize: (value) => value.replace(ansiRegex(), ''),
271
+ test: () => true,
272
+ });
273
+ expect(() =>
274
+ tsTransform(dedent`
275
+ import * as SB from '@storybook/react';
276
+ import { CatProps } from './Cat';
277
+
278
+ const meta = { title: 'Cat', component: Cat } as Meta<CatProps>
279
+ export default meta;
280
+
281
+ export const A: SB.StoryFn<CatProps> = () => <Cat />;
282
+ `)
283
+ ).toThrowErrorMatchingInlineSnapshot(`
284
+ This codemod does not support namespace imports for a @storybook/react package.
285
+ Replace the namespace import with named imports and try again.
286
+ `);
287
+ });
288
+ it('should keep local names', () => {
289
+ expect(
290
+ tsTransform(dedent`
291
+ import { Meta, StoryObj as CSF3, StoryFn as CSF2 } from '@storybook/react';
292
+ import { CatProps } from './Cat';
293
+
294
+ const meta = { title: 'Cat', component: Cat } satisfies Meta<CatProps>
295
+ export default meta;
296
+
297
+ export const A: CSF2<CatProps> = () => <Cat />;
298
+
299
+ export const B: CSF3<CatProps> = {
300
+ args: { name: "already csf3" }
301
+ };
302
+
303
+ export const C: CSF2<CatProps> = (args) => <Cat {...args} />;
304
+ C.args = {
305
+ name: "Fluffy"
306
+ };
307
+ `)
308
+ ).toMatchInlineSnapshot(`
309
+ import { Meta, StoryObj as CSF3, StoryFn as CSF2 } from '@storybook/react';
310
+ import { CatProps } from './Cat';
311
+
312
+ const meta = { title: 'Cat', component: Cat } satisfies Meta<CatProps>;
313
+ export default meta;
314
+
315
+ export const A: CSF2<CatProps> = () => <Cat />;
316
+
317
+ export const B: CSF3<CatProps> = {
318
+ args: { name: 'already csf3' },
319
+ };
320
+
321
+ export const C: CSF3<CatProps> = {
322
+ args: {
323
+ name: 'Fluffy',
324
+ },
325
+ };
326
+ `);
327
+ });
328
+
329
+ it('should replace function exports with objects and update type', () => {
330
+ expect(
331
+ tsTransform(dedent`
332
+ import { Story, StoryFn, ComponentStory, ComponentStoryObj } from '@storybook/react';
333
+
334
+ // some extra whitespace to test
335
+
336
+ export default {
337
+ title: 'Cat',
338
+ component: Cat,
339
+ } as Meta<CatProps>;
340
+
341
+ export const A: Story<CatProps> = (args) => <Cat {...args} />;
342
+ A.args = { name: "Fluffy" };
343
+
344
+ export const B: any = (args) => <Button {...args} />;
345
+
346
+ export const C: Story<CatProps> = () => <Cat />;
347
+
348
+ export const D: StoryFn<CatProps> = (args) => <Cat {...args} />;
349
+ D.args = {
350
+ name: "Fluffy"
351
+ };
352
+
353
+ export const E: ComponentStory<Cat> = (args) => <Cat {...args} />;
354
+ E.args = { name: "Fluffy" };
355
+
356
+ export const F: Story = (args) => <Cat {...args} />;
357
+ F.args = {
358
+ name: "Fluffy"
359
+ };
360
+
361
+ export const G: ComponentStoryObj<typeof Cat> = {
362
+ args: {
363
+ name: 'Fluffy',
364
+ },
365
+ };
366
+ `)
367
+ ).toMatchInlineSnapshot(`
368
+ import { StoryObj, StoryFn } from '@storybook/react';
369
+
370
+ // some extra whitespace to test
371
+
372
+ export default {
373
+ title: 'Cat',
374
+ component: Cat,
375
+ } as Meta<CatProps>;
376
+
377
+ export const A: StoryObj<CatProps> = {
378
+ args: { name: 'Fluffy' },
379
+ };
380
+
381
+ export const B: any = {
382
+ render: (args) => <Button {...args} />,
383
+ };
384
+
385
+ export const C: StoryFn<CatProps> = () => <Cat />;
386
+
387
+ export const D: StoryObj<CatProps> = {
388
+ args: {
389
+ name: 'Fluffy',
390
+ },
391
+ };
392
+
393
+ export const E: StoryObj<Cat> = {
394
+ args: { name: 'Fluffy' },
395
+ };
396
+
397
+ export const F: StoryObj = {
398
+ args: {
399
+ name: 'Fluffy',
400
+ },
401
+ };
402
+
403
+ export const G: StoryObj<typeof Cat> = {
404
+ args: {
405
+ name: 'Fluffy',
406
+ },
407
+ };
408
+ `);
409
+ });
410
+
411
+ it('migrate Story type to StoryFn when used in an not exported Template function', () => {
412
+ expect(
413
+ tsTransform(dedent`
414
+ import { Story, Meta } from '@storybook/react'
415
+
416
+ export default {
417
+ component: Cat,
418
+ } satisfies Meta
419
+
420
+ const Template: Story = () => <div>Hello World</div>;
421
+
422
+ export const Default = Template.bind({})
423
+ `)
424
+ ).toMatchInlineSnapshot(`
425
+ import { StoryFn, Meta } from '@storybook/react';
426
+
427
+ export default {
428
+ component: Cat,
429
+ } satisfies Meta;
430
+
431
+ const Template: StoryFn = () => <div>Hello World</div>;
432
+
433
+ export const Default = {
434
+ render: Template,
435
+ };
436
+ `);
437
+ });
438
+ });
439
+ });