From 258fe1322750e7c8823e0385ffed277b0b813127 Mon Sep 17 00:00:00 2001 From: Martin Macko Date: Sat, 11 Aug 2018 19:00:52 +0200 Subject: [PATCH 1/3] Fix autodetection of used components in info addon Closes #3989 --- addons/info/src/components/Story.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/info/src/components/Story.js b/addons/info/src/components/Story.js index 5201f7e3eb7a..cf3bed071a79 100644 --- a/addons/info/src/components/Story.js +++ b/addons/info/src/components/Story.js @@ -330,8 +330,8 @@ class Story extends Component { innerChildren.forEach(extract); return; } - if (innerChildren.props && innerChildren.props.innerChildren) { - extract(innerChildren.props.innerChildren); + if (innerChildren.props && innerChildren.props.children) { + extract(innerChildren.props.children); } if ( typeof innerChildren === 'string' || From 88d000ec6821eb9f02bfe368031f6cc6a9e6cb33 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 24 Aug 2018 21:22:59 +0200 Subject: [PATCH 2/3] FIX snapshots --- .../info/src/__snapshots__/index.test.js.snap | 98 +++++++++ .../__snapshots__/index.stories.storyshot | 27 +++ .../addon-info.stories.storyshot | 188 ++++++++++++++++++ 3 files changed, 313 insertions(+) diff --git a/addons/info/src/__snapshots__/index.test.js.snap b/addons/info/src/__snapshots__/index.test.js.snap index e88575b55e15..842fb68d013e 100644 --- a/addons/info/src/__snapshots__/index.test.js.snap +++ b/addons/info/src/__snapshots__/index.test.js.snap @@ -1250,6 +1250,55 @@ exports[`addon Info should render and external markdown 1`] = ` +
+

+ Prop Types +

+
+

+ " + TestComponent + " Component +

+ + + + No propTypes defined! + + + +
+
@@ -2601,6 +2650,55 @@ containing **bold**, *cursive* text, \`code\` and [a link](https://github.com)" +
+

+ Prop Types +

+
+

+ " + TestComponent + " Component +

+ + + + No propTypes defined! + + + +
+
diff --git a/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot b/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot index d1187a7970f0..cedc3dd0594c 100644 --- a/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot +++ b/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot @@ -198,6 +198,23 @@ exports[`Storyshots Button addons composition 1`] = ` +
+

+ Prop Types +

+
+

+ "InfoButton" Component +

+ + No propTypes defined! + +
+
@@ -573,6 +590,16 @@ exports[`Storyshots Button with new info 1`] = ` +
+

+ "InfoButton" Component +

+ + No propTypes defined! + +
diff --git a/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot b/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot index 79198981beb1..493cb024a8bd 100644 --- a/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot +++ b/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot @@ -423,6 +423,33 @@ exports[`Storyshots Addons|Info.GitHub issues #1814 1`] = ` +
+

+ Prop Types +

+
+

+ "" Component +

+ + No propTypes defined! + +
+
+

+ "" Component +

+ + No propTypes defined! + +
+
@@ -5019,6 +5046,167 @@ exports[`Storyshots Addons|Info.Options.propTablesExclude Exclude component from +
+

+ Prop Types +

+
+

+ "BaseButton" Component +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + + + - + + + false + + +
+ label + + + + yes + + - + +
+ onClick + + + + - + + + onClick + + +
+ style + + + + - + + + {} + + +
+
+
From 622c5c377915889c55e1f11b2def68e9b775208a Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 24 Aug 2018 21:52:56 +0200 Subject: [PATCH 3/3] FIX snapshots --- .../addon-info.stories.storyshot | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot b/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot index d80f08c7b508..3b8a0976911a 100644 --- a/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot +++ b/examples/official-storybook/stories/__snapshots__/addon-info.stories.storyshot @@ -5059,32 +5059,32 @@ exports[`Storyshots Addons|Info.Options.propTablesExclude Exclude component from "BaseButton" Component @@ -5093,22 +5093,22 @@ exports[`Storyshots Addons|Info.Options.propTablesExclude Exclude component from
property propType required default description
disabled -
label yes -
onClick -
style -