diff --git a/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.metadata.test.js.snap b/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.metadata.test.js.snap new file mode 100644 index 00000000000..90a67c28c8a --- /dev/null +++ b/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.metadata.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Text Simple 1`] = `"contents"`; diff --git a/addons/storyshots/storyshots-core/stories/exported_metadata/Text.stories.js b/addons/storyshots/storyshots-core/stories/exported_metadata/Text.stories.js new file mode 100644 index 00000000000..e87143f2c78 --- /dev/null +++ b/addons/storyshots/storyshots-core/stories/exported_metadata/Text.stories.js @@ -0,0 +1,5 @@ +export default { + title: 'Text', +}; + +export const Simple = () => 'contents'; diff --git a/addons/storyshots/storyshots-core/stories/exported_metadata/main.js b/addons/storyshots/storyshots-core/stories/exported_metadata/main.js new file mode 100644 index 00000000000..f6e10c62569 --- /dev/null +++ b/addons/storyshots/storyshots-core/stories/exported_metadata/main.js @@ -0,0 +1,3 @@ +module.exports = { + stories: ['./Text.stories.js'], +}; diff --git a/addons/storyshots/storyshots-core/stories/exported_metadata/preview.js b/addons/storyshots/storyshots-core/stories/exported_metadata/preview.js new file mode 100644 index 00000000000..724c84b9a43 --- /dev/null +++ b/addons/storyshots/storyshots-core/stories/exported_metadata/preview.js @@ -0,0 +1,12 @@ +import React from 'react'; + +export const decorators = [ + (StoryFn, { parameters, globals }) => ( +
+ {parameters.prefix} {globals.suffix} +
+ ), +]; + +export const parameters = { prefix: 'prefix' }; +export const globals = { suffix: 'suffix' }; diff --git a/addons/storyshots/storyshots-core/stories/storyshot.metadata.test.js b/addons/storyshots/storyshots-core/stories/storyshot.metadata.test.js new file mode 100644 index 00000000000..38d2d3c1d79 --- /dev/null +++ b/addons/storyshots/storyshots-core/stories/storyshot.metadata.test.js @@ -0,0 +1,9 @@ +import path from 'path'; +import initStoryshots from '../dist'; + +// jest.mock('@storybook/node-logger'); + +initStoryshots({ + framework: 'react', + configPath: path.join(__dirname, 'exported_metadata'), +});