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 and Vue storyshots #2564

Merged
merged 75 commits into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
97c2b42
Initial dirty-half-working-POC of the storyshots for angular
igor-dv Dec 26, 2017
edb1cf6
Refactor storyshots index.js
igor-dv Dec 26, 2017
c208016
Refactor test-bodies
igor-dv Dec 26, 2017
e0bae92
Better copy-past from app/angular
igor-dv Dec 26, 2017
91f17b6
Remove things
igor-dv Dec 26, 2017
8f549fa
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Dec 28, 2017
714b694
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Dec 28, 2017
43a273b
Merge branch 'master' into angular-storyshots
igor-dv Dec 29, 2017
d9942cf
Fix indentation in package.json
igor-dv Dec 29, 2017
2c460e4
Extract more stories to separate files
igor-dv Dec 29, 2017
887182f
Support promises in storyshots
igor-dv Dec 29, 2017
9cffe0a
Allow loading html templates
igor-dv Dec 29, 2017
29e84bd
Update snapshots
igor-dv Dec 29, 2017
f9e83ca
Merge branch 'master' into angular-storyshots
igor-dv Dec 29, 2017
b09b631
Few cleanups
igor-dv Dec 29, 2017
3c782a6
Merge branch 'master' into angular-storyshots
igor-dv Jan 1, 2018
3802a8e
Merge branch 'master' into angular-storyshots
ndelangen Jan 1, 2018
3cbd772
Add vue storyshots fork
igor-dv Jan 1, 2018
db89374
Extract common config-loading logic to a separate module
igor-dv Jan 1, 2018
7193eee
Merge remote-tracking branch 'origin/angular-storyshots' into vue-sto…
igor-dv Jan 1, 2018
36daf9c
Use config-loader in vue/loader
igor-dv Jan 1, 2018
5ba2e9e
Use prepare script in storyshots
igor-dv Jan 3, 2018
84237fb
Angular + Jest + Storyshots = Crazy Shit. Move the `jest-preset-angul…
igor-dv Jan 3, 2018
4b612eb
Merge remote-tracking branch 'origin/angular-storyshots' into vue-sto…
igor-dv Jan 3, 2018
796deb5
Merge branch 'master' into angular-storyshots
igor-dv Jan 3, 2018
7fc4888
Define global.STORYBOOK_ENV to be 'vue' because there are addons that…
igor-dv Jan 3, 2018
08cbbc8
Move angular and react to regular reps
igor-dv Jan 3, 2018
51b91d8
Merge remote-tracking branch 'origin/angular-storyshots' into vue-sto…
igor-dv Jan 3, 2018
347bdc2
Add utils.test.js
igor-dv Jan 3, 2018
637a919
Fix indentation
igor-dv Jan 3, 2018
a0d4e10
Merge pull request #2614 from storybooks/vue-storyshots
ndelangen Jan 3, 2018
ea2db19
Wrap story with app.component like in the app/angular and set dynamic…
igor-dv Jan 3, 2018
a1fd3cf
typo and indentation
igor-dv Jan 3, 2018
6a5b3b8
Merge branch 'master' into angular-storyshots
igor-dv Jan 3, 2018
c35d48b
Update yarn.lock
igor-dv Jan 3, 2018
3bb8ab9
Move angular back to peer to check if cli tests are failing.
igor-dv Jan 3, 2018
45c7f24
Remove angular and vue deps from storyshots and suppress no-extraneou…
igor-dv Jan 3, 2018
ee1fad4
Remove react from deps as well and remove wildcard from react-test-re…
igor-dv Jan 3, 2018
a7a6324
Merge branch 'master' into angular-storyshots
igor-dv Jan 3, 2018
3aa07d0
Update yarn.lock
igor-dv Jan 3, 2018
279090c
Disable each specific import separately with ugly "eslint-disable-nex…
igor-dv Jan 3, 2018
7730d21
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 3, 2018
acfd41e
Disable with specific rule, so the imports will be even uglier
igor-dv Jan 3, 2018
23b85f0
Merge branch 'master' into angular-storyshots
igor-dv Jan 4, 2018
c4b7ecf
Merge branch 'master' into angular-storyshots
igor-dv Jan 4, 2018
6115fe1
Merge branch 'master' into angular-storyshots
igor-dv Jan 4, 2018
0b57690
Merge branch 'master' into angular-storyshots
igor-dv Jan 4, 2018
de37c4b
Merge branch 'master' into angular-storyshots
ndelangen Jan 4, 2018
08ec56b
Merge branch 'master' into angular-storyshots
igor-dv Jan 5, 2018
e304771
Add docs for angular and vue
igor-dv Jan 6, 2018
227aaf5
Merge branch 'master' into angular-storyshots
igor-dv Jan 6, 2018
8eee1c0
Now I need to update snapshots...
igor-dv Jan 6, 2018
2aac993
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 8, 2018
11687bd
After merge fixes
igor-dv Jan 8, 2018
b0f4064
Update snapshots
igor-dv Jan 8, 2018
ea9adf3
Merge branch 'master' into angular-storyshots
igor-dv Jan 8, 2018
c3b5aa7
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 10, 2018
805f73e
Update snapshots
igor-dv Jan 10, 2018
2e30203
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 10, 2018
a5eb21c
Update storyshots to use helpers with templates support
igor-dv Jan 10, 2018
9ba4b74
Generalize api. import react-test-renderer only in react loader
igor-dv Jan 10, 2018
64506b4
Remove jest-preset-angular and react-test-renderer from deps.
igor-dv Jan 10, 2018
cb3029e
Merge branch 'master' into angular-storyshots
igor-dv Jan 10, 2018
2ca902a
Merge branch 'master' into angular-storyshots
igor-dv Jan 11, 2018
c2ced8d
Update README
igor-dv Jan 11, 2018
9091f4a
Add deps issue description to README
igor-dv Jan 11, 2018
d17f61b
Fix docs
igor-dv Jan 11, 2018
f68a410
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 11, 2018
d5b30aa
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 12, 2018
5fcf200
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 14, 2018
878aa75
Merge branch 'master' into angular-storyshots
igor-dv Jan 14, 2018
53b9a3a
Fix image snapshot to err on RN
igor-dv Jan 14, 2018
89af8fe
Merge branch 'master' into angular-storyshots
igor-dv Jan 15, 2018
db75151
Merge branch 'master' into angular-storyshots
igor-dv Jan 15, 2018
760d3c7
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv Jan 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions addons/storyshots/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
"babel-runtime": "^6.26.0",
"glob": "^7.1.2",
"global": "^4.3.2",
"jest-preset-angular": "^5.0.0",
"jest-specific-snapshot": "^0.3.0",
"prop-types": "^15.6.0",
"react-test-renderer": "^16.2.0",
"read-pkg-up": "^3.0.0"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions addons/storyshots/src/angular/renderTree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies
Copy link
Member

@Hypnosphi Hypnosphi Jan 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are people expected to get jest-preset-angular dependency? As contrary to @angular/core, it's by no means guaranteed to be present in an angular project

import AngularSnapshotSerializer from 'jest-preset-angular/AngularSnapshotSerializer';
// eslint-disable-next-line import/no-extraneous-dependencies
import HTMLCommentSerializer from 'jest-preset-angular/HTMLCommentSerializer';
// eslint-disable-next-line import/no-extraneous-dependencies
import { TestBed } from '@angular/core/testing';
Expand Down
1 change: 1 addition & 0 deletions addons/storyshots/src/react/renderShallowTree.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People who are already using Storyshots were already needed to install react-test-renderer, so for them, there won't be a problem. I need to add a section in Readme about these "optional peers", that people have to install by hand.
BTW, For angular and vue these deps are needed to configure jestconfig (I've already added it to readme)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me

import shallow from 'react-test-renderer/shallow';

function getRenderedTree(story, context, { renderer, serializer }) {
Expand Down
1 change: 1 addition & 0 deletions addons/storyshots/src/react/renderTree.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import reactTestRenderer from 'react-test-renderer';

function getRenderedTree(story, context, { renderer, serializer, ...rendererOptions }) {
Expand Down