Testing utilities that allow you to reuse your Storybook stories in your React unit tests!
:tada: This release contains work from a new contributor! :tada:
Thank you, Kasper Peulen (@kasperpeulen), for all your work!
Storybook 7.0.0 is out! This release will make @storybook/testing-react
compatible with Storybook 7, though I highly recommend not to use this package anymore!.
@storybook/testing-react
has been promoted to a first-class Storybook functionality in Storybook 7. This means that you no longer need this package. Instead, you can import the same utilities, but from the @storybook/react
package. Additionally, the internals of composeStories
and composeStory
have been revamped, so the way a story is composed is more accurate. The @storybook/testing-react
package will be deprecated, so we recommend you to migrate.
Please do the following:
- import { composeStories } from '@storybook/testing-react';
+ import { composeStories } from '@storybook/react';
// OR
- import { setProjectAnnotations } from '@storybook/testing-react';
+ import { setProjectAnnotations } from '@storybook/react';
Thank you so much for being with me on this journey! ✌️
This version adds support for Storybook 7.0. It requires you to be using Storybook 7.0, as there were several internal changes required, all of which depend on new Storybook packages.
In Storybook 7.0, the play function can also be defined in the Meta (default export). This is now supported in @storybook/testing-react
.
The setGlobalConfig
function is now deprecated in favor of setProjectAnnotations
, which aligns better with Storybook 7.0 nomenclature.
From:
import { setGlobalConfig } from '@storybook/testing-react';
import * as globalStorybookConfig from './.storybook/preview';
setGlobalConfig(globalStorybookConfig);
To:
import { setProjectAnnotations } from '@storybook/testing-react';
import * as globalStorybookConfig from './.storybook/preview';
setProjectAnnotations(globalStorybookConfig);
name
-> storyName
#108 (@IanVS):tada: This release contains work from a new contributor! :tada:
Thank you, Kasper Peulen (@kasperpeulen), for all your work!
This version adds support for Storybook 7.0. It requires you to be using Storybook 7.0, as there were several internal changes required, all of which depend on new Storybook packages.
In Storybook 7.0, the play function can also be defined in the Meta (default export). This is now supported in @storybook/testing-react
.
The setGlobalConfig
function is now deprecated in favor of setProjectAnnotations
, which aligns better with Storybook 7.0 nomenclature.
From:
import { setGlobalConfig } from '@storybook/testing-react';
import * as globalStorybookConfig from './.storybook/preview';
setGlobalConfig(globalStorybookConfig);
To:
import { setProjectAnnotations } from '@storybook/testing-react';
import * as globalStorybookConfig from './.storybook/preview';
setProjectAnnotations(globalStorybookConfig);
:tada: This release contains work from new contributors! :tada:
Thanks for all your work!
:heart: Matt Harker (@TeaSeaLancs)
:heart: Alejandro Ñáñez Ortiz (@alejandronanez)
:tada: This release contains work from new contributors! :tada:
Thanks for all your work!
:heart: Fabien (@frassinier)
:heart: Imgbot (@ImgBotApp)
:heart: Tatsushi Toji (@tatsushitoji)
main