From a58fe9a10076f61b9ba4acca715538a59cbbc9da Mon Sep 17 00:00:00 2001 From: Aruna Herath Date: Tue, 27 Dec 2016 17:55:19 +0530 Subject: [PATCH] Provide storybook context to render --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index fefda44d2bed..99665d3ae570 100644 --- a/src/index.js +++ b/src/index.js @@ -52,7 +52,8 @@ export default function testStorySnapshots (options = {}) { describe(group.kind, () => { for (const story of group.stories) { it(story.name, () => { - const renderedStory = story.render() + const context = { kind: group.kind, story: story.name } + const renderedStory = story.render(context) const tree = renderer.create(renderedStory).toJSON() expect(tree).toMatchSnapshot() })