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

[Addon-storyshots] Remove default options on "goto" call #3298

Conversation

thomasbertet
Copy link
Contributor

Issue: #3288

What I did

  • Add ability to pass a new argument specifying the options of the goto call (puppeteer API) via getGotoOptions argument on the imageSnapshot storyshot method.

How to test

  • Run yarn test --image

Why

  • I suggested a default config that may not suit every use cases, so I removed it and added an option to pass it (or any other option) of the goto puppeteer method

@codecov
Copy link

codecov bot commented Mar 27, 2018

Codecov Report

Merging #3298 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3298   +/-   ##
=======================================
  Coverage   36.09%   36.09%           
=======================================
  Files         445      445           
  Lines        9783     9783           
  Branches      906      902    -4     
=======================================
  Hits         3531     3531           
- Misses       5655     5669   +14     
+ Partials      597      583   -14
Impacted Files Coverage Δ
addons/storyshots/src/test-body-image-snapshot.js 13.79% <ø> (ø) ⬆️
...s/actions/src/lib/types/function/createFunction.js 53.33% <0%> (ø) ⬆️
lib/ui/src/modules/ui/configs/init_panels.js 25% <0%> (ø) ⬆️
addons/actions/src/lib/retrocycle.js 48.83% <0%> (ø) ⬆️
addons/jest/src/hoc/provideJestResult.js 0% <0%> (ø) ⬆️
app/react/src/demo/Welcome.js 63.15% <0%> (ø) ⬆️
...codemod/src/transforms/update-organisation-name.js 40.62% <0%> (ø) ⬆️
addons/storysource/src/loader/inject-decorator.js 28% <0%> (ø) ⬆️
addons/knobs/src/components/types/Color.js 8.1% <0%> (ø) ⬆️
...ns/viewport/src/manager/components/viewportInfo.js 33.33% <0%> (ø) ⬆️
... and 52 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5cf5714...9543644. Read the comment docs.


```js
import initStoryshots, { imageSnapshot } from '@storybook/addon-storyshots';
const getGotoOptions = ({context, url}) {
Copy link
Member

Choose a reason for hiding this comment

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

missing arrow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wow so bad ! Thanks !

@thomasbertet thomasbertet force-pushed the fix-3288-storyshots-default-goto-options branch from e7d6ab7 to 9713b4a Compare March 27, 2018 15:33
@thomasbertet
Copy link
Contributor Author

@Hypnosphi that's fixed, thanks for the review !

@Hypnosphi Hypnosphi merged commit 4cab8d0 into storybookjs:master Mar 27, 2018
@thomasbertet thomasbertet deleted the fix-3288-storyshots-default-goto-options branch March 28, 2018 11:04
@Hypnosphi Hypnosphi added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Mar 29, 2018
Hypnosphi added a commit that referenced this pull request Mar 30, 2018
…t-goto-options

[Addon-storyshots] Remove default options on "goto" call
@Hypnosphi Hypnosphi added the patch:done Patch/release PRs already cherry-picked to main/release branch label Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: storyshots bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants