FIX tests

This commit is contained in:
Norbert de Langen 2018-12-22 00:26:30 +01:00
parent 053473882e
commit 28a50f41a7
No known key found for this signature in database
GPG Key ID: 976651DA156C2825
2 changed files with 680 additions and 194 deletions

View File

@ -607,10 +607,12 @@ exports[`Storyshots Addons|Info/GitHub issues #1814 1`] = `
<div <div
style="position:relative;z-index:0" style="position:relative;z-index:0"
> >
<input <div>
type="text" <input
/> type="text"
<textarea /> />
<textarea />
</div>
</div> </div>
<button <button
class="info__show-button" class="info__show-button"
@ -676,18 +678,30 @@ exports[`Storyshots Addons|Info/GitHub issues #1814 1`] = `
class="css-1igagyr-Code epklh873" class="css-1igagyr-Code epklh873"
> >
<span <span
class="token operator" class="token tag"
> >
&lt; <span
class="token tag"
>
<span
class="token punctuation"
>
&lt;
</span>
div
</span>
<span
class="token punctuation"
>
&gt;
</span>
</span> </span>
<span <span
class="token operator" class="token plain-text"
> >
&gt;
</span> </span>
<span <span
class="token tag" class="token tag"
> >
@ -720,43 +734,68 @@ exports[`Storyshots Addons|Info/GitHub issues #1814 1`] = `
/&gt; /&gt;
</span> </span>
</span> </span>
<span <span
class="token operator" class="token plain-text"
> >
&lt;
</span>
No Display Name
<span
class="token operator"
>
/
</span>
<span
class="token operator"
>
&gt;
</span>
<span
class="token operator"
>
&lt;
</span>
<span
class="token operator"
>
/
</span> </span>
<span <span
class="token operator" class="token tag"
> >
&gt; <span
class="token tag"
>
<span
class="token punctuation"
>
&lt;
</span>
No
</span>
<span
class="token attr-name"
>
Display
</span>
<span
class="token attr-name"
>
Name
</span>
<span
class="token punctuation"
>
/&gt;
</span>
</span>
<span
class="token plain-text"
>
</span>
<span
class="token tag"
>
<span
class="token tag"
>
<span
class="token punctuation"
>
&lt;/
</span>
div
</span>
<span
class="token punctuation"
>
&gt;
</span>
</span> </span>
@ -791,16 +830,6 @@ No Display Name
No propTypes defined! No propTypes defined!
</small> </small>
</div> </div>
<div>
<h3
style="margin:20px 0 0 0"
>
"" Component
</h3>
<small>
No propTypes defined!
</small>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -858,25 +887,27 @@ exports[`Storyshots Addons|Info/JSX Displays JSX in description 1`] = `
<div <div
style="margin-bottom:0" style="margin-bottom:0"
> >
<h2> <div>
This is a JSX info section <h2>
</h2> This is a JSX info section
<p> </h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at libero nulla. <p>
</p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at libero nulla.
<p> </p>
<a <p>
href="https://github.com/storybooks/react-storybook-addon-info" <a
> href="https://github.com/storybooks/react-storybook-addon-info"
This is a link >
</a> This is a link
</p> </a>
<p> </p>
<img <p>
alt="350x150" <img
src="http://placehold.it/350x150" alt="350x150"
/> src="http://placehold.it/350x150"
</p> />
</p>
</div>
</div> </div>
<div> <div>
<h1 <h1
@ -3809,6 +3840,423 @@ exports[`Storyshots Addons|Info/Options.propTables Shows additional component pr
</div> </div>
`; `;
exports[`Storyshots Addons|Info/Options.propTablesExclude Exclude component from prop tables 1`] = `
<div>
<div
style="position:relative;z-index:0"
>
<div>
<button
type="button"
>
Button
</button>
<button
type="button"
>
Flow Typed Button
</button>
</div>
</div>
<button
class="info__show-button"
style="font-family:sans-serif;font-size:12px;display:block;position:fixed;border:none;background:#28c;color:#fff;padding:5px 15px;cursor:pointer;top:0;right:0;border-radius:0 0 0 5px"
type="button"
>
Show Info
</button>
<div
class="info__overlay"
style="position:fixed;background:white;top:0;bottom:0;left:0;right:0;padding:0 40px;overflow:auto;z-index:99999;display:none"
>
<button
class="info__close-button"
style="font-family:sans-serif;font-size:12px;display:block;position:fixed;border:none;background:#28c;color:#fff;padding:5px 15px;cursor:pointer;top:0;right:0;border-radius:0 0 0 5px"
type="button"
>
×
</button>
<div>
<div
style="font-family:-apple-system, \\".SFNSText-Regular\\", \\"San Francisco\\", BlinkMacSystemFont, \\"Segoe UI\\", \\"Roboto\\", \\"Oxygen\\", \\"Ubuntu\\", \\"Cantarell\\", \\"Fira Sans\\", \\"Droid Sans\\", \\"Helvetica Neue\\", \\"Lucida Grande\\", \\"Arial\\", sans-serif;color:#444;-webkit-font-smoothing:antialiased;font-weight:300;line-height:1.45;font-size:15px;border:1px solid #eee;padding:20px 40px 40px;border-radius:2px;background-color:#fff;margin-top:20px;margin-bottom:20px"
>
<div
style="border-bottom:1px solid #eee;padding-top:10px;margin-bottom:10px"
>
<h1
style="margin:0;padding:0;font-size:35px"
>
Addons|Info/Options.propTablesExclude
</h1>
<h2
style="margin:0 0 10px 0;padding:0;font-weight:400;font-size:22px"
>
Exclude component from prop tables
</h2>
</div>
<div
style="margin-bottom:0"
>
<div
style="font-family:-apple-system, \\".SFNSText-Regular\\", \\"San Francisco\\", BlinkMacSystemFont, \\"Segoe UI\\", \\"Roboto\\", \\"Oxygen\\", \\"Ubuntu\\", \\"Cantarell\\", \\"Fira Sans\\", \\"Droid Sans\\", \\"Helvetica Neue\\", \\"Lucida Grande\\", \\"Arial\\", sans-serif;color:#444;-webkit-font-smoothing:antialiased;font-size:15px"
>
This can exclude extraneous components from being displayed in prop tables.
</div>
</div>
<div>
<h1
style="margin:20px 0 0 0;padding:0 0 5px 0;font-size:25px;border-bottom:1px solid #EEE"
>
Story Source
</h1>
<div
class="css-fri0s0-Wrapper epklh870"
>
<div
class="css-1y75e3d-Scroller epklh871"
>
<pre
class="hljs css-1x8ad3z-Pre epklh872"
>
<code
class="css-1igagyr-Code epklh873"
>
<span
class="token tag"
>
<span
class="token tag"
>
<span
class="token punctuation"
>
&lt;
</span>
div
</span>
<span
class="token punctuation"
>
&gt;
</span>
</span>
<span
class="token plain-text"
>
</span>
<span
class="token tag"
>
<span
class="token tag"
>
<span
class="token punctuation"
>
&lt;
</span>
BaseButton
</span>
<span
class="token attr-name"
>
label
</span>
<span
class="token attr-value"
>
<span
class="token punctuation"
>
=
</span>
<span
class="token punctuation"
>
"
</span>
Button
<span
class="token punctuation"
>
"
</span>
</span>
<span
class="token punctuation"
>
/&gt;
</span>
</span>
<span
class="token plain-text"
>
</span>
<span
class="token tag"
>
<span
class="token tag"
>
<span
class="token punctuation"
>
&lt;
</span>
FlowTypeButton
</span>
<span
class="token attr-name"
>
label
</span>
<span
class="token attr-value"
>
<span
class="token punctuation"
>
=
</span>
<span
class="token punctuation"
>
"
</span>
Flow Typed Button
<span
class="token punctuation"
>
"
</span>
</span>
<span
class="token punctuation"
>
/&gt;
</span>
</span>
<span
class="token plain-text"
>
</span>
<span
class="token tag"
>
<span
class="token tag"
>
<span
class="token punctuation"
>
&lt;/
</span>
div
</span>
<span
class="token punctuation"
>
&gt;
</span>
</span>
</code>
</pre>
</div>
</div>
</div>
<div>
<h1
style="margin:20px 0 0 0;padding:0 0 5px 0;font-size:25px;border-bottom:1px solid #EEE"
>
Prop Types
</h1>
<div>
<h3
style="margin:20px 0 0 0"
>
"BaseButton" Component
</h3>
<table
class="css-919xfk-Table-Table e1fg2ikb0"
>
<thead
class="css-ig77mj-THead e1fg2ikb1"
>
<tr>
<th
class="css-6pdatc-Th-TH e1fg2ikb2"
>
Property
</th>
<th
class="css-6pdatc-Th-TH e1fg2ikb2"
>
Type
</th>
<th
class="css-6pdatc-Th-TH e1fg2ikb2"
>
Required
</th>
<th
class="css-6pdatc-Th-TH e1fg2ikb2"
>
Default
</th>
<th
class="css-6pdatc-Th-TH e1fg2ikb2"
>
Description
</th>
</tr>
</thead>
<tbody
class="css-4b5un0-TBody e1fg2ikb3"
>
<tr
class="css-rss5jh-TBodyTR e1fg2ikb4"
>
<td
class="css-v0hv6k-Td-TD-TDName e1fg2ikb6"
>
disabled
</td>
<td
class="css-yv1lmn-Td-TD-TDType e1fg2ikb7"
>
<span>
bool
</span>
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
-
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
<span>
false
</span>
</td>
<td
class="css-a1xhq0-Td-TD e1fg2ikb5"
/>
</tr>
<tr
class="css-rss5jh-TBodyTR e1fg2ikb4"
>
<td
class="css-v0hv6k-Td-TD-TDName e1fg2ikb6"
>
label
</td>
<td
class="css-yv1lmn-Td-TD-TDType e1fg2ikb7"
>
<span>
string
</span>
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
yes
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
-
</td>
<td
class="css-a1xhq0-Td-TD e1fg2ikb5"
/>
</tr>
<tr
class="css-rss5jh-TBodyTR e1fg2ikb4"
>
<td
class="css-v0hv6k-Td-TD-TDName e1fg2ikb6"
>
onClick
</td>
<td
class="css-yv1lmn-Td-TD-TDType e1fg2ikb7"
>
<span>
func
</span>
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
-
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
<span>
onClick
</span>
</td>
<td
class="css-a1xhq0-Td-TD e1fg2ikb5"
/>
</tr>
<tr
class="css-rss5jh-TBodyTR e1fg2ikb4"
>
<td
class="css-v0hv6k-Td-TD-TDName e1fg2ikb6"
>
style
</td>
<td
class="css-yv1lmn-Td-TD-TDType e1fg2ikb7"
>
<span>
other
</span>
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
-
</td>
<td
class="css-6qgefz-Td-TD e1fg2ikb5"
>
<span>
{}
</span>
</td>
<td
class="css-a1xhq0-Td-TD e1fg2ikb5"
/>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Storyshots Addons|Info/Options.source Shows or hides Info Addon source 1`] = ` exports[`Storyshots Addons|Info/Options.source Shows or hides Info Addon source 1`] = `
<div> <div>
<div <div
@ -8780,14 +9228,16 @@ exports[`Storyshots Addons|Info/Story Source Children 1`] = `
<div <div
style="position:relative;z-index:0" style="position:relative;z-index:0"
> >
<p> <div>
Here is my nice button: <p>
</p> Here is my nice button:
<button </p>
type="button" <button
> type="button"
Button >
</button> Button
</button>
</div>
</div> </div>
<button <button
class="info__show-button" class="info__show-button"
@ -8844,18 +9294,30 @@ exports[`Storyshots Addons|Info/Story Source Children 1`] = `
class="css-1igagyr-Code epklh873" class="css-1igagyr-Code epklh873"
> >
<span <span
class="token operator" class="token tag"
> >
&lt; <span
class="token tag"
>
<span
class="token punctuation"
>
&lt;
</span>
div
</span>
<span
class="token punctuation"
>
&gt;
</span>
</span> </span>
<span <span
class="token operator" class="token plain-text"
> >
&gt;
</span> </span>
<span <span
class="token tag" class="token tag"
> >
@ -8901,108 +9363,142 @@ exports[`Storyshots Addons|Info/Story Source Children 1`] = `
&gt; &gt;
</span> </span>
</span> </span>
<span <span
class="token operator" class="token plain-text"
> >
&lt;
</span>
BaseButton
label
<span
class="token operator"
>
=
</span>
<span
class="token string"
>
"Button"
</span>
onClick
<span
class="token operator"
>
=
</span>
<span
class="token punctuation"
>
{
</span>
<span
class="token keyword"
>
function
</span>
<span
class="token function"
>
noRefCheck
</span> </span>
<span <span
class="token punctuation" class="token tag"
> >
( <span
class="token tag"
>
<span
class="token punctuation"
>
&lt;
</span>
BaseButton
</span>
<span
class="token attr-name"
>
label
</span>
<span
class="token attr-value"
>
<span
class="token punctuation"
>
=
</span>
<span
class="token punctuation"
>
"
</span>
Button
<span
class="token punctuation"
>
"
</span>
</span>
<span
class="token attr-name"
>
onClick
</span>
<span
class="token script language-javascript"
>
<span
class="token script-punctuation punctuation"
>
=
</span>
<span
class="token punctuation"
>
{
</span>
<span
class="token keyword"
>
function
</span>
<span
class="token function"
>
noRefCheck
</span>
<span
class="token punctuation"
>
(
</span>
<span
class="token punctuation"
>
)
</span>
<span
class="token punctuation"
>
{
</span>
<span
class="token punctuation"
>
}
</span>
<span
class="token punctuation"
>
}
</span>
</span>
<span
class="token punctuation"
>
/&gt;
</span>
</span> </span>
<span <span
class="token punctuation" class="token plain-text"
> >
)
</span>
<span
class="token punctuation"
>
{
</span>
<span
class="token punctuation"
>
}
</span>
<span
class="token punctuation"
>
}
</span>
<span
class="token operator"
>
/
</span> </span>
<span <span
class="token operator" class="token tag"
> >
&gt; <span
</span> class="token tag"
>
<span <span
class="token operator" class="token punctuation"
> >
&lt; &lt;/
</span> </span>
div
</span>
<span <span
class="token operator" class="token punctuation"
> >
/ &gt;
</span> </span>
<span
class="token operator"
>
&gt;
</span> </span>
@ -9185,16 +9681,6 @@ onClick
</tbody> </tbody>
</table> </table>
</div> </div>
<div>
<h3
style="margin:20px 0 0 0"
>
"" Component
</h3>
<small>
No propTypes defined!
</small>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,4 +1,4 @@
import React, { Fragment } from 'react'; import React from 'react';
import { storiesOf } from '@storybook/react'; import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info'; import { withInfo } from '@storybook/addon-info';
import { action } from '@storybook/addon-actions'; import { action } from '@storybook/addon-actions';
@ -100,7 +100,7 @@ storiesOf('Addons|Info/Markdown', module)
); );
const JSXDescription = ( const JSXDescription = (
<Fragment> <div>
<h2>This is a JSX info section</h2> <h2>This is a JSX info section</h2>
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
@ -113,7 +113,7 @@ const JSXDescription = (
<p> <p>
<img alt="350x150" src="http://placehold.it/350x150" /> <img alt="350x150" src="http://placehold.it/350x150" />
</p> </p>
</Fragment> </div>
); );
storiesOf('Addons|Info/JSX', module) storiesOf('Addons|Info/JSX', module)
@ -180,10 +180,10 @@ storiesOf('Addons|Info/Options.propTablesExclude', module)
.add( .add(
'Exclude component from prop tables', 'Exclude component from prop tables',
() => ( () => (
<Fragment> <div>
<BaseButton label="Button" /> <BaseButton label="Button" />
<FlowTypeButton label="Flow Typed Button" /> <FlowTypeButton label="Flow Typed Button" />
</Fragment> </div>
), ),
{ {
info: { info: {
@ -249,10 +249,10 @@ storiesOf('Addons|Info/GitHub issues', module)
.add( .add(
'#1814', '#1814',
() => ( () => (
<Fragment> <div>
<Input /> <Input />
<TextArea /> <TextArea />
</Fragment> </div>
), ),
{ {
info: 'Allow Duplicate DisplayNames for HOC #1814', info: 'Allow Duplicate DisplayNames for HOC #1814',
@ -331,10 +331,10 @@ storiesOf('Addons|Info/Story Source', module)
.add('One prop', () => <BaseButton label="Button" />) .add('One prop', () => <BaseButton label="Button" />)
.add('Many props', () => <BaseButton label="Button" onClick={action('clicked')} disabled />) .add('Many props', () => <BaseButton label="Button" onClick={action('clicked')} disabled />)
.add('Children', () => ( .add('Children', () => (
<Fragment> <div>
<p>Here is my nice button:</p> <p>Here is my nice button:</p>
<BaseButton label="Button" onClick={action('clicked')} /> <BaseButton label="Button" onClick={action('clicked')} />
</Fragment> </div>
)) ))
.add('Array prop', () => { .add('Array prop', () => {
const propDefs = [ const propDefs = [