diff --git a/example/stories/decorator.js b/example/stories/decorator.js index 0911686..ec4ff33 100644 --- a/example/stories/decorator.js +++ b/example/stories/decorator.js @@ -12,7 +12,7 @@ const Simple = props => ( storiesOf('Decorator', module) .addDecorator(jsxDecorator) - .addWithJSX( + .add( 'Simple Array', () => (
@@ -22,7 +22,7 @@ storiesOf('Decorator', module) ), { skip: 1 } ) - .addWithJSX( + .add( 'Array with function', () => (
@@ -33,7 +33,7 @@ storiesOf('Decorator', module) ), { skip: 1 } ) - .addWithJSX( + .add( 'Array with nested component', () => (
diff --git a/example/stories/fragments.js b/example/stories/fragments.js new file mode 100644 index 0000000..866d042 --- /dev/null +++ b/example/stories/fragments.js @@ -0,0 +1,27 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; +import { jsxDecorator } from '../../lib/index'; + +const Component = () =>
; +const Simple = props => ( +
+ Hello + {props.children} +
+); + +storiesOf('Fragments', module) + .addDecorator(jsxDecorator) + .add('Simple Fragment', () => ( + +
+
+ + )) + .add('Array', () => [
,
]) + .add('Fragment Shorthand', () => ( + <> +
+
+ + )); diff --git a/example/stories/index.js b/example/stories/index.js index 13a3f78..e38489f 100644 --- a/example/stories/index.js +++ b/example/stories/index.js @@ -5,5 +5,6 @@ import './simple'; import './deep'; import './decorator'; import './functions'; +import './fragments'; import './array'; import './withProps'; diff --git a/src/__tests__/__snapshots__/index.test.js.snap b/src/__tests__/__snapshots__/index.test.js.snap index 87fa1ca..c52a369 100644 --- a/src/__tests__/__snapshots__/index.test.js.snap +++ b/src/__tests__/__snapshots__/index.test.js.snap @@ -193,6 +193,27 @@ exports[`Storyshots Deep Test With children - Skip and rename 1`] = `
`; +exports[`Storyshots Fragments Array 1`] = ` +Array [ +
, +
, +] +`; + +exports[`Storyshots Fragments Fragment Shorthand 1`] = ` +Array [ +
, +
, +] +`; + +exports[`Storyshots Fragments Simple Fragment 1`] = ` +Array [ +
, +
, +] +`; + exports[`Storyshots Function as a children Deep function - No options 1`] = `