Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular: Convert angular-cli stories to CSF #7668

Merged
merged 4 commits into from Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/angular-cli/jest.config.js
Expand Up @@ -8,6 +8,7 @@ module.exports = {
},
roots: [__dirname],
transform: {
'^.+\\.stories\\.[jt]sx?$': '@storybook/addon-storyshots/injectFileName',
'^.+\\.jsx?$': '<rootDir>/scripts/babel-jest.js',
'^.+[/\\\\].storybook[/\\\\]config\\.ts$': '<rootDir>/scripts/jest-ts-babel.js',
'^.+\\.html$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
Expand Down
@@ -1,34 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Addon|Actions Action and method 1`] = `
exports[`Storyshots Addon|Actions Action And Method 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-button-component
_nghost-a-c1=""
_nghost-a-c14=""
>
<button
_ngcontent-a-c1=""
_ngcontent-a-c14=""
>
Action and Method
</button>
</storybook-button-component>
</storybook-dynamic-app-root>
`;

exports[`Storyshots Addon|Actions Action only 1`] = `
exports[`Storyshots Addon|Actions Action Only 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-button-component
_nghost-a-c0=""
_nghost-a-c13=""
>
<button
_ngcontent-a-c0=""
_ngcontent-a-c13=""
>
Action only
</button>
Expand Down
Expand Up @@ -72,11 +72,11 @@ exports[`Storyshots Addon|Background background template 1`] = `
>
<ng-component>
<storybook-button-component
_nghost-a-c2=""
_nghost-a-c0=""
ng-reflect-text="Hello Button"
>
<button
_ngcontent-a-c2=""
_ngcontent-a-c0=""
>
Hello Button
</button>
Expand Down
Expand Up @@ -92,11 +92,11 @@ exports[`Storyshots Addon|Centered centered template 1`] = `
style="margin: auto; max-height: 100%;"
>
<storybook-button-component
_nghost-a-c3=""
_nghost-a-c1=""
ng-reflect-text="Hello Button"
>
<button
_ngcontent-a-c3=""
_ngcontent-a-c1=""
>
Hello Button
</button>
Expand Down
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Addon|Jest app.component with jest tests 1`] = `
exports[`Storyshots Addon|Jest App Component With Jest Tests 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
Expand Down
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Addon|Knobs All knobs 1`] = `
exports[`Storyshots Addon|Knobs All Knobs 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
Expand Down Expand Up @@ -76,7 +76,7 @@ exports[`Storyshots Addon|Knobs Simple 1`] = `
</storybook-dynamic-app-root>
`;

exports[`Storyshots Addon|Knobs XSS safety 1`] = `
exports[`Storyshots Addon|Knobs Xss Safety 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
Expand Down
@@ -1,16 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Addon|Links button with link to another story 1`] = `
exports[`Storyshots Addon|Links Button With Link To Another Story 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-button-component
_nghost-a-c4=""
_nghost-a-c15=""
>
<button
_ngcontent-a-c4=""
_ngcontent-a-c15=""
>
Go to Welcome Story
</button>
Expand Down
@@ -1,34 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Addon|Notes Note with HTML 1`] = `
exports[`Storyshots Addon|Notes Note With Html 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-button-component
_nghost-a-c6=""
_nghost-a-c17=""
>
<button
_ngcontent-a-c6=""
_ngcontent-a-c17=""
>
Notes with HTML
</button>
</storybook-button-component>
</storybook-dynamic-app-root>
`;

exports[`Storyshots Addon|Notes Simple note 1`] = `
exports[`Storyshots Addon|Notes Simple Note 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-button-component
_nghost-a-c5=""
_nghost-a-c16=""
>
<button
_ngcontent-a-c5=""
_ngcontent-a-c16=""
>
Notes on some Button
</button>
Expand Down
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots App Component Component with separate template 1`] = `
exports[`Storyshots App Component Component With Separate Template 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
Expand Down
@@ -1,18 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Core|Parameters passed to story 1`] = `
exports[`Storyshots Core|Parameters Passed To Story 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-button-component
_nghost-a-c7=""
_nghost-a-c18=""
>
<button
_ngcontent-a-c7=""
_ngcontent-a-c18=""
>
Parameters are {"options":{"hierarchyRootSeparator":{},"hierarchySeparator":{}},"docs":{"iframeHeight":"60px"},"globalParameter":"globalParameter","framework":"angular","chapterParameter":"chapterParameter","storyParameter":"storyParameter"}
Parameters are {"options":{"hierarchyRootSeparator":{},"hierarchySeparator":{}},"docs":{"iframeHeight":"60px"},"globalParameter":"globalParameter","framework":"angular","chapterParameter":"chapterParameter","storyParameter":"storyParameter","displayName":"passed to story"}
</button>
</storybook-button-component>
</storybook-dynamic-app-root>
Expand Down
Expand Up @@ -14,7 +14,7 @@ exports[`Storyshots Custom|Pipes Simple 1`] = `
</storybook-dynamic-app-root>
`;

exports[`Storyshots Custom|Pipes With Knobs 1`] = `
exports[`Storyshots Custom|Pipes With Knobs Story 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
Expand Down
Expand Up @@ -17,7 +17,7 @@ exports[`Storyshots Custom|Providers Simple 1`] = `
</storybook-dynamic-app-root>
`;

exports[`Storyshots Custom|Providers With knobs 1`] = `
exports[`Storyshots Custom|Providers With Knobs Story 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
Expand Down
@@ -1,18 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Custom|Style Default 1`] = `
exports[`Storyshots Custom|Style Default Story 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<ng-component>
<storybook-button-component
_nghost-a-c8=""
_nghost-a-c19=""
ng-reflect-text="Button with custom styles"
>
<button
_ngcontent-a-c8=""
_ngcontent-a-c19=""
>
Button with custom styles
</button>
Expand All @@ -21,19 +21,19 @@ exports[`Storyshots Custom|Style Default 1`] = `
</storybook-dynamic-app-root>
`;

exports[`Storyshots Custom|Style With Knobs 1`] = `
exports[`Storyshots Custom|Style With Knobs Story 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<ng-component>
<storybook-button-component
_nghost-a-c9=""
_nghost-a-c20=""
ng-reflect-text="Button with custom styles"
>
<button
_ngcontent-a-c9=""
_ngcontent-a-c20=""
>
Button with custom styles
</button>
Expand Down