mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
FIX snapshots && IMPROVE the DX of integrityTestTemplate
This commit is contained in:
parent
98d647563f
commit
ae915f75a5
@ -16,7 +16,8 @@ function integrityTest(integrityOptions, stories2snapsConverter) {
|
||||
const possibleStoriesFiles = stories2snapsConverter.getPossibleStoriesFiles(fileName);
|
||||
return !possibleStoriesFiles.some(fs.existsSync);
|
||||
});
|
||||
expect(abandonedStoryshots.length).toBe(0);
|
||||
|
||||
expect(abandonedStoryshots).toEqual([]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|a11y Default 1`] = `<button />`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Delayed render 1`] = `<div />`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Disabled 1`] = `
|
||||
<button
|
||||
disabled=""
|
||||
>
|
||||
Testing the a11y addon
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Invalid contrast 1`] = `
|
||||
<button
|
||||
style="color: black; background-color: brown;"
|
||||
>
|
||||
Testing the a11y addon
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Label 1`] = `
|
||||
<button>
|
||||
Testing the a11y addon
|
||||
</button>
|
||||
`;
|
@ -1,62 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Actions Decorated actions + config 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Decorated actions 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Hello World 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions + config 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions, object + config 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions, object 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions, selector 1`] = `
|
||||
|
||||
|
||||
`;
|
@ -1,17 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Backgrounds story 1 1`] = `
|
||||
<span
|
||||
style="color: white"
|
||||
>
|
||||
You should be able to switch backgrounds for this story
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Backgrounds story 2 1`] = `
|
||||
<span
|
||||
style="color: white"
|
||||
>
|
||||
This one too!
|
||||
</span>
|
||||
`;
|
@ -1,17 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Centered button in center 1`] = `
|
||||
<div
|
||||
id="sb-addon-centered-wrapper"
|
||||
style="position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; display: flex; align-items: center; overflow: auto;"
|
||||
>
|
||||
<div
|
||||
id="sb-addon-centered-inner"
|
||||
style="margin: auto; max-height: 100%;"
|
||||
>
|
||||
<button>
|
||||
I am a Button !
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
@ -1,6 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Events Logger 1`] = `
|
||||
|
||||
|
||||
`;
|
@ -1,3 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Jest withTests 1`] = `This story shows test results`;
|
@ -1,70 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Knobs All knobs 1`] = `
|
||||
<div
|
||||
style="border: 2px dotted deeppink; padding: 8px 22px; border-radius: 8px"
|
||||
>
|
||||
|
||||
|
||||
<h1>
|
||||
My name is Jane,
|
||||
</h1>
|
||||
|
||||
|
||||
<h3>
|
||||
today is January 20, 2017
|
||||
</h3>
|
||||
|
||||
|
||||
<p>
|
||||
I have a stock of 20 apples, costing $2.25 each.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
Also, I have:
|
||||
</p>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Laptop
|
||||
</li>
|
||||
<li>
|
||||
Book
|
||||
</li>
|
||||
<li>
|
||||
Whiskey
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Nice to meet you!
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs CSS transitions 1`] = `
|
||||
<p
|
||||
style="transition: color 0.5s ease-out; color: orangered;"
|
||||
>
|
||||
John Doe
|
||||
</p>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs DOM 1`] = `
|
||||
<p>
|
||||
John Doe
|
||||
</p>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs Simple 1`] = `
|
||||
<div>
|
||||
I am John Doe and I'm 44 years old.
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs XSS safety 1`] = `<img src=x onerror="alert('XSS Attack')" >`;
|
@ -1,15 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Notes Simple note 1`] = `
|
||||
<p>
|
||||
|
||||
|
||||
<strong>
|
||||
|
||||
This is a fragment of HTML
|
||||
|
||||
</strong>
|
||||
|
||||
|
||||
</p>
|
||||
`;
|
@ -1,34 +1,5 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Demo button 1`] = `
|
||||
<button>
|
||||
Hello Button
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Demo heading 1`] = `
|
||||
<h1>
|
||||
Hello World
|
||||
</h1>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Demo headings 1`] = `
|
||||
<section>
|
||||
<h1>
|
||||
Hello World
|
||||
</h1>
|
||||
<h2>
|
||||
Hello World
|
||||
</h2>
|
||||
<h3>
|
||||
Hello World
|
||||
</h3>
|
||||
<h4>
|
||||
Hello World
|
||||
</h4>
|
||||
</section>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Welcome Welcome 1`] = `
|
||||
<div
|
||||
class="main"
|
@ -0,0 +1,239 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Storyshots Addons|Actions Decorated actions + config 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Decorated actions 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Hello World 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions + config 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions, object + config 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions, object 1`] = `
|
||||
<button
|
||||
type="button"
|
||||
>
|
||||
Hello World
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Actions Multiple actions, selector 1`] = `
|
||||
|
||||
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Backgrounds story 1 1`] = `
|
||||
<span
|
||||
style="color: white"
|
||||
>
|
||||
You should be able to switch backgrounds for this story
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Backgrounds story 2 1`] = `
|
||||
<span
|
||||
style="color: white"
|
||||
>
|
||||
This one too!
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Centered button in center 1`] = `
|
||||
<div
|
||||
id="sb-addon-centered-wrapper"
|
||||
style="position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; display: flex; align-items: center; overflow: auto;"
|
||||
>
|
||||
<div
|
||||
id="sb-addon-centered-inner"
|
||||
style="margin: auto; max-height: 100%;"
|
||||
>
|
||||
<button>
|
||||
I am a Button !
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Events Logger 1`] = `
|
||||
|
||||
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Jest withTests 1`] = `This story shows test results`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs All knobs 1`] = `
|
||||
<div
|
||||
style="border: 2px dotted deeppink; padding: 8px 22px; border-radius: 8px"
|
||||
>
|
||||
|
||||
|
||||
<h1>
|
||||
My name is Jane,
|
||||
</h1>
|
||||
|
||||
|
||||
<h3>
|
||||
today is January 20, 2017
|
||||
</h3>
|
||||
|
||||
|
||||
<p>
|
||||
I have a stock of 20 apples, costing $2.25 each.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
Also, I have:
|
||||
</p>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Laptop
|
||||
</li>
|
||||
<li>
|
||||
Book
|
||||
</li>
|
||||
<li>
|
||||
Whiskey
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Nice to meet you!
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs CSS transitions 1`] = `
|
||||
<p
|
||||
style="transition: color 0.5s ease-out; color: orangered;"
|
||||
>
|
||||
John Doe
|
||||
</p>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs DOM 1`] = `
|
||||
<p>
|
||||
John Doe
|
||||
</p>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs Simple 1`] = `
|
||||
<div>
|
||||
I am John Doe and I'm 44 years old.
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|Knobs XSS safety 1`] = `<img src=x onerror="alert('XSS Attack')" >`;
|
||||
|
||||
exports[`Storyshots Addons|Notes Simple note 1`] = `
|
||||
<p>
|
||||
|
||||
|
||||
<strong>
|
||||
|
||||
This is a fragment of HTML
|
||||
|
||||
</strong>
|
||||
|
||||
|
||||
</p>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Default 1`] = `<button />`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Delayed render 1`] = `<div />`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Disabled 1`] = `
|
||||
<button
|
||||
disabled=""
|
||||
>
|
||||
Testing the a11y addon
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Invalid contrast 1`] = `
|
||||
<button
|
||||
style="color: black; background-color: brown;"
|
||||
>
|
||||
Testing the a11y addon
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Addons|a11y Label 1`] = `
|
||||
<button>
|
||||
Testing the a11y addon
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Demo button 1`] = `
|
||||
<button>
|
||||
Hello Button
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Demo heading 1`] = `
|
||||
<h1>
|
||||
Hello World
|
||||
</h1>
|
||||
`;
|
||||
|
||||
exports[`Storyshots Demo headings 1`] = `
|
||||
<section>
|
||||
<h1>
|
||||
Hello World
|
||||
</h1>
|
||||
<h2>
|
||||
Hello World
|
||||
</h2>
|
||||
<h3>
|
||||
Hello World
|
||||
</h3>
|
||||
<h4>
|
||||
Hello World
|
||||
</h4>
|
||||
</section>
|
||||
`;
|
Loading…
x
Reference in New Issue
Block a user