Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: @storybook/test does not work correctly with userEvent.pointer in build mode #30658

Open
DiFuks opened this issue Feb 25, 2025 · 1 comment

Comments

@DiFuks
Copy link

DiFuks commented Feb 25, 2025

Describe the bug

When using userEvent.pointer to move an element, the movement works in dev mode but not in build mode. The interaction test passes in one case and fails in the other

await userEvent.pointer([
	{ keys: `[TouchA>]`, target: sliderHandle },
	{
		pointerName: `TouchA`,
		target: sliderTrack,
		coords: { x: targetX },
	},
	{ keys: `[/TouchA]` },
]);

Reproduction link

https://codesandbox.io/p/devbox/pkdntw?file=%2Fsrc%2FSlider.stories.tsx

Reproduction steps

  1. pnpm run dev
  2. open http://localhost:6006 and run Slider interaction test. Test passes
  3. pnpm run build
  4. open http://localhost:6007 and run Slider interaction test. Test fails

System

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 AMD EPYC
    Shell: Unknown
  Binaries:
    Node: 20.12.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.5.0 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/share/npm-global/bin/pnpm <----- active
  npmPackages:
    @storybook/addon-essentials: ^8.6.0 => 8.6.0 
    @storybook/addon-interactions: ^8.6.0 => 8.6.0 
    @storybook/addon-onboarding: ^8.6.0 => 8.6.0 
    @storybook/blocks: ^8.6.0 => 8.6.0 
    @storybook/react: ^8.6.0 => 8.6.0 
    @storybook/react-vite: ^8.6.0 => 8.6.0 
    @storybook/test: ^8.6.0 => 8.6.0 
    eslint-plugin-storybook: ^0.11.3 => 0.11.3 
    storybook: ^8.6.0 => 8.6.0

Additional context

No response

@valentinpalkovic
Copy link
Contributor

Hi @DiFuks

Thank you for reporting!

Is this a regression in Storybook 8.6.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants