question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storyshot shallow rendering with decorators

See original GitHub issue

Describe the bug When shallow rendering with decorators the snapshot generated is useless. For example:

// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Components|Avatar default 1`] = `
<StoryRouter
  story={[Function]}
/>
`;

To Reproduce Steps to reproduce the behavior:

  1. Create a story
  2. Configure storyshots to use shallow rendering
  3. Configure storyshots to use a decorator, (e.g. https://github.com/gvaldambrini/storybook-router)

Expected behavior The snapshot contains the serialized component being tested.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shilmancommented, Jun 11, 2019

@ewolfe Aha sorry about that. Reopening!

0reactions
stale[bot]commented, Aug 1, 2019

Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Storyshots Addon | Storybook: Frontend workshop for UI ...
Take a snapshot of a shallow-rendered version of the component. Note that this option will be overridden if you pass a renderer option....
Read more >
Technical & Organizational Benefits of Storybook Snapshot ...
Use shallow rendering to avoid large snapshots that are prone to breakage; Run StoryShots tests separate from your other tests ...
Read more >
How to test decorated React component with shallow rendering
You can't. First let's slightly desugar the decorator: let PlayerProfile = withMUI( class PlayerProfile extends React.Component { // .
Read more >
React Native Storybook + Generating individual test files to ...
Storyshots works by taking a snapshot (via jest + enzyme shallow render) of each of your stories automatically. To set up storybook and ......
Read more >
provide better example for async snapshot testing #7745
import initStoryshots, { Stories2SnapsConverter } from "@storybook/addon-storyshots"; import { shallow, mount } from "enzyme"; import { act } from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found