You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
Describe the bug
We use vitest with testing-library/react for our component tests. While upgrading dependencies recently, something broke all of our tests and I've narrowed it down to this plugin, despite the fact that we don't even use it.
In all of our component tests, we have an import like this:
import { act, fireEvent, render, screen } from '@testing-library/react'
Then, a test uses it like so:
it('calls the onClick handler',async()=>{constuser=userEvent.setup()constspiedOnClick=vi.fn()render(<DropdownButtonmenu={menu}onClick={spiedOnClick}text='Submit'/>)awaitact(async()=>{awaituser.click(screen.getByRole('button'))})expect(spiedOnClick).toHaveBeenCalled()})
However, when upgrading from @storybook/testing-library 0.1.0 to 0.2.0, every test that uses the above import fails:
Warning: The current testing environment is not configured to support act(...)
Expected behavior
This was not an error in 0.1.0.
Screenshots
If applicable, add screenshots to help explain your problem.
Describe the bug
We use vitest with testing-library/react for our component tests. While upgrading dependencies recently, something broke all of our tests and I've narrowed it down to this plugin, despite the fact that we don't even use it.
In all of our component tests, we have an import like this:
import { act, fireEvent, render, screen } from '@testing-library/react'
Then, a test uses it like so:
However, when upgrading from @storybook/testing-library 0.1.0 to 0.2.0, every test that uses the above import fails:
Warning: The current testing environment is not configured to support act(...)
Expected behavior
This was not an error in 0.1.0.
Screenshots
If applicable, add screenshots to help explain your problem.
System
Environment Info:
System:
OS: Windows 10 10.0.22621
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Binaries:
Node: 18.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 3.4.1 - C:\Program Files\nodejs\yarn.CMD
npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.1992.0), Chromium (115.0.1901.188)
npmPackages:
@storybook/addon-docs: 7.0.11 => 7.0.11
@storybook/addon-essentials: 7.0.11 => 7.0.11
@storybook/addon-interactions: 7.0.11 => 7.0.11
@storybook/addon-links: 7.0.11 => 7.0.11
@storybook/addon-mdx-gfm: 7.0.11 => 7.0.11
@storybook/react: 7.0.11 => 7.0.11
@storybook/react-vite: 7.0.11 => 7.0.11
@storybook/testing-library: 0.2.0 => 0.2.0
The text was updated successfully, but these errors were encountered: