I'm getting an error on my Jest tests:
FAIL test/storyshots.test.ts
● Test suite failed to run
TypeError: require.requireActual is not a function
1 | import initStoryshots from "@storybook/addon-storyshots"
2 |
> 3 |…
I'm using Storyshots with storybook for snapshot testing.
Referred to the documentation here: link1, link2
The complete error log
Followed all the steps here, but don't know why the error is coming :)
You can find the code here
I have also searched…
I'm trying to render a modal using a portal, it works fine in my application as well as in Storybook, but as soon as it is added to Storyshots I run into problems.
The first issue was to mock ReactDOM's createPortal API. I did it…
I'm using Jest + Storyshots to test my (React) webapp, but the components are always rendered in a 1024px-wide viewport, even if I specify a different viewport in the story. Am I using Storybook the wrong way or is it a (known) bug ? Currently I…
I am using the StoryShots addon for Storybook to test snapshots from my React project. I would like to save all snapshot files in one directory in relation to the project directory. The default is that the snapshots are saved in relation to the…
How to generate snapshots for all possible knob options? Right now storybook with storyshots and jest can make screenshots only for default component state, which doesn't cover all possible variants.
I understand that there's a possible way by…
I have configured storybooks(6.1.14) for angular (11), I am currently importing mdx file into CSF(.stories.ts). Stories are compiling fine but when I run jest (for snapshot testing), it throws error
Cannot find module './SampleComponent.mdx' or its…
I am getting `` error when testing my IndeterminateCheckbox component below:
import { Checkbox } from '@chakra-ui/core';
import React from 'react';
export interface IndeterminateCheckboxProps {
indeterminate: boolean;
checked: boolean;
title:…
When I try to run tests for storyshots with native screens enabled for react-navigation I get this:
Native stack is only available if React Native Screens is enabled.
15 | const getRenderedTree = (story: any) => {
16 | const storyElement =…
Having issue where i want to use a custom browser for storyshot with jest but I'm having a hard time finding any example or docs about managing the browser lifecycle - it's just mentioned offhand. My initStoryshots looks like this
initStoryshots({
…
Haven't been able to find documentation on this anywhere in Storybook or the Storyshots addon. I am receiving this error in the CI job which runs this script:
jest --collectCoverage --runInBand
The error is:
Found abandoned storyshots. Run jest with…
"@material-ui/core": "4.12.3"
"@storybook/addon-storyshots": "6.3.12",
"@storybook/react": "6.3.12",
"react": "17.0.2",
Cannot use Dialog in a Storybook Storyshots test without errors, because the workarounds to get ReactDOM.createPortal and…
Problem Summary
Storybook snapshot test on static storybook returning blank screenshots even though they look fine on localhost:8080 when I ran npx http-server storybook-static
Tech stack and relevant code
Vue…
I have just installed @storybook/addon-storyshots and followed their instruction to put it at the root.
src/Storyshots.test.ts
import initStoryshots from '@storybook/addon-storyshots';
initStoryshots();
When I run tests, all my existing tests pass…
I want to use renderOnly mode for my Storyshots tests, but I am getting errors in some stories.
I can fix these errors by adding
createNodeMock: node => document.createElement (node.type)
but now I am losing renderOnly.