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.

Storyshots does it really checks based on screenshots?

See original GitHub issue

Hi guys,

Sorry for bothering you with such a silly question, but I can’t make heads of the comparison feature of the addon.

In all the examples (in README.md of Storyshots project and in the Jest snapshot testing) is shown only the process of comparing attributes and text inside a component.

But what about CSS and Styling?

What if I change padding from let’s say 16px to 0 I bet the component will change significantly, so what should the snapshot do then? Pass test or fail down? I am 100% that it must fail, because just comparing a screenshot with another screenshot will show the underlying difference.

I mean I have checked it, it really gives:

 PASS  .storybook/storyshots.test.js
  Storyshots
    Button
      ✓ With text (26ms)

I cannot believe that it bothers only me, there must me someone else, who asked the same question.

Thanks for the answering in advance.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Hypnosphicommented, Nov 22, 2017

Here’s the snippet I use for generation:

for (const {kind, stories} of items) {
  gemini.suite(kind, () => {
    for (const story of stories) {
      gemini.suite(story, suite => {
        suite
          .setUrl(`iframe.html?selectedKind=${kind}&selectedStory=${story}`)
          .setCaptureElements('#root')
          .capture(story)
      })
    }
  })
}
0reactions
AlexanderTserkovniycommented, Nov 22, 2017

Actually I was working on a tool that creates a gemini config authomatically based on stories tree form storyshots addon

And how is it going now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Storyshots does it really checks based on screenshots?
Storyshots are not visual screenshots, they are rather snapshots of your React tree. So they won't detect a difference in styling unless those ......
Read more >
Storyshots Addon | Storybook: Frontend workshop for UI ...
StoryShots. StoryShots adds automatic Jest Snapshot Testing for Storybook. ... Then you can see all of your stories are converted as Jest snapshot...
Read more >
Technical & Organizational Benefits of Storybook Snapshot ...
StoryShots and snapshot testing do not assert correctness · StoryShots and snapshot testing is more like static checking · StoryShots encourages ...
Read more >
Screenshot Testing with React - Angelo Dini
Sadly reality is often disappointing, and we need to write tests. In this article, I'll focus on screenshot testing. The tutorial was tested ......
Read more >
Storybook Snapshot Testing
Storybook's Storyshot Addon does exactly this: it repurposes existing Storybook stories for Jest snapshot testing. It takes these stories ...
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