Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Latest commit

 

History

History
628 lines (355 loc) · 18.5 KB

CHANGELOG.md

File metadata and controls

628 lines (355 loc) · 18.5 KB

v2.0.0 (Mon Apr 03 2023)

🎉 This release contains work from a new contributor! 🎉

Thank you, Kasper Peulen (@kasperpeulen), for all your work!

Release Notes

Support 7.0.0 (#140)

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:

  1. Uninstall this package
  2. Update your imports
- 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! ✌️

Support Storybook 7.0 (#120)

💥 Breaking Change

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.

🚀 Features

In Storybook 7.0, the play function can also be defined in the Meta (default export). This is now supported in @storybook/testing-react.

⚠️ Deprecations

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);


💥 Breaking Change

🐛 Bug Fix

Authors: 4


v1.3.0 (Thu May 19 2022)

🎉 This release contains work from new contributors! 🎉

Thanks for all your work!

❤️ Matt Harker (@TeaSeaLancs)

❤️ Alejandro Ñáñez Ortiz (@alejandronanez)

🚀 Enhancement

🐛 Bug Fix

Authors: 3


v1.2.4 (Sun Mar 20 2022)

🐛 Bug Fix

Authors: 2


v1.2.3 (Wed Jan 12 2022)

🎉 This release contains work from new contributors! 🎉

Thanks for all your work!

❤️ Fabien (@frassinier)

❤️ Imgbot (@ImgBotApp)

❤️ Tatsushi Toji (@tatsushitoji)

🐛 Bug Fix

⚠️ Pushed to main

📝 Documentation

Authors: 5


v1.2.2 (Tue Dec 07 2021)

🐛 Bug Fix

  • fix: align global config types with Storybook 6.4 #75 (@yannbf)

Authors: 1


v1.2.1 (Mon Dec 06 2021)

🐛 Bug Fix

🔩 Dependency Updates

Authors: 2


v1.2.0 (Sat Dec 04 2021)

🐛 Bug Fix

  • feat: add storyName to composed story #65 (@yannbf)

Authors: 1


v1.1.0 (Sat Dec 04 2021)

Release Notes

feat: support exclude/include stories (#64)

Features

This version adds support for the includeStories and excludeStories parameter to filter non-story exports (#64)


🚀 Enhancement

  • feat: support exclude/include stories #64 (@yannbf)

Authors: 1


v1.0.0 (Tue Nov 23 2021)

🎉 This release contains work from new contributors! 🎉

Thanks for all your work!

❤️ Tom Coleman (@tmeasday)

❤️ null@jonniebigodes

Release Notes

Version 1.0.0 (#60)

💥 Breaking Change

Updates Storybook peer dependency to 6.4

Features

CSF3

Storybook 6.4 released a new version of CSF, where the story can also be an object. This is supported in @storybook/testing-react, but you have to match the requisites:

1 - Either your story has a render method or your meta contains a component property:

// Example 1: Meta with component property
export default {
  title: 'Button',
  component: Button // <-- This is strictly necessary
}

// Example 2: Story with render method:
export const Primary = {
  render: (args) => <Button {...args}>
}

Play function

Storybook 6.4 also brings a new function called play, where you can write automated interactions to the story.

In @storybook/testing-react, the play function does not run automatically for you, but rather comes in the returned component, and you can execute it as you please.

Consider the following example:

export const InputFieldFilled: Story<InputFieldProps> = {
  play: async ({ canvasElement }) => {
    const canvas = within(canvasElement);
    await userEvent.type(canvas.getByRole('textbox'), 'Hello world!');
  },
};

You can use the play function like this:

const { InputFieldFilled } = composeStories(stories);

test('renders with play function', async () => {
  const { container } = render(<InputFieldFilled />);

  // pass container as canvasElement and play an interaction that fills the input
  await InputFieldFilled.play({ canvasElement: container });

  const input = screen.getByRole('textbox') as HTMLInputElement;
  expect(input.value).toEqual('Hello world!');
});

📝 Documentation

  • Chore: (Docs) Updates the assets used in the documentation for the addon #52 (@jonniebigodes)

Authors: 3


v0.0.22 (Sun Aug 15 2021)

🎉 This release contains work from a new contributor! 🎉

Thank you, null@payapula, for all your work!

Release Notes

Revert CSF3 support (#43)

Fixes

CSF3 support was added in a previous version, however conflicted with projects using Storybook 6.3. The correct typescript types come from Storybook 6.4, rendering this library incompatible with projects using Storybook 6.3. This release reverts the CSF3 support, which will be brought to the next major release of @storybook/testing-react.


🐛 Bug Fix

📝 Documentation

Authors: 2


v0.0.19 (Thu Jul 15 2021)

Release Notes

feat: support CSF3 format (#37)

Features

Storybook released CSF3, where the story can also be an object. This is now supported in @storybook/testing-react. CSF3 also brings a new function called play, where you can write automated interactions to the story.

In @storybook/testing-react, the play does not run automatically for you, but rather comes in the returned component, and you can execute it as you please.

Consider the following example:

export const InputFieldFilled: Story<InputFieldProps> = {
  play: async () => {
    await userEvent.type(screen.getByRole('textbox'), 'Hello world!');
  },
};

You can use the play function like this:

const { InputFieldFilled } = composeStories(stories);

test('renders with play function', async () => {
  render(<InputFieldFilled />);

  // play an interaction that fills the input
  await InputFieldFilled.play!();

  const input = screen.getByRole('textbox') as HTMLInputElement;
  expect(input.value).toEqual('Hello world!');
});

🐛 Bug Fix

Authors: 1


v0.0.18 (Fri Jun 25 2021)

🐛 Bug Fix

⚠️ Pushed to main

Authors: 1


v0.0.17 (Thu Jun 03 2021)

🐛 Bug Fix

  • Widen peer dependency range to include prereleases #26 (@IanVS)

Authors: 1


v0.0.16 (Mon May 24 2021)

🐛 Bug Fix

  • fix: move storybook libs as peer deps #23 (@yannbf)

Authors: 1


v0.0.15 (Sun May 23 2021)

🐛 Bug Fix

  • feat: add args as a result from composed story #19 (@yannbf)

Authors: 1


v0.0.14 (Sun May 23 2021)

🐛 Bug Fix

  • fix: Remove deep import StoryFnReactReturnType from @storybook/react #20 (@ljcl)

Authors: 1


v0.0.13 (Fri May 21 2021)

🐛 Bug Fix

  • fix: ignore __esModules flag when composing stories #22 (@yannbf)

Authors: 1


v0.0.13 (Fri May 21 2021)

🐛 Bug Fix

  • fix: ignore __esModules flag when composing stories #22 (@yannbf)

Authors: 1


v0.0.12 (Wed May 12 2021)

🐛 Bug Fix

Authors: 1


v0.0.11 (Sat May 08 2021)

🐛 Bug Fix

  • fix: throw error on unsupported formats #18 (@yannbf)

Authors: 1


v0.0.10 (Mon Apr 05 2021)

🐛 Bug Fix

  • fix: support addons that use channel api #14 (@yannbf)

Authors: 1


v0.0.9 (Tue Mar 30 2021)

🐛 Bug Fix

  • Fix: properly handle global types support #11 (@yannbf)

Authors: 1


v0.0.8 (Tue Mar 30 2021)

🐛 Bug Fix

Authors: 1


v0.0.7 (Tue Mar 30 2021)

🐛 Bug Fix

Authors: 2


v0.0.6 (Mon Mar 22 2021)

🐛 Bug Fix

Authors: 1


v0.0.5 (Fri Mar 19 2021)

🐛 Bug Fix

  • docs: fix wrong import in instructions #3 (@yannbf)

Authors: 1


v0.0.4 (Fri Mar 19 2021)

🐛 Bug Fix

Authors: 1


v0.0.3 (Wed Mar 17 2021)

⚠️ Pushed to main

Authors: 1


v0.0.2 (Tue Mar 16 2021)

⚠️ Pushed to main

Authors: 2


0.0.1

Initial version