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/experimental-addon-test removed testing-library props from canvas #30405

Open
rhuanbarreto opened this issue Jan 29, 2025 · 0 comments

Comments

@rhuanbarreto
Copy link

Describe the bug

When trying to integrate the @storybook/experimental-addon-test plugin, everything worked "fine" but of course I had some quirks. Many on reproducibility between the addon and on the browser but all of them were actual issues on my code. Only one thing is bugging me: tsc.

Typescript now complains that the type of the canvas property of the play function context doesn't have the functions from testing-library anymore. Before, on @storybook/addon-interactions I had all those testing library functions under canvas and I didn't need to use within(canvasElement).findBy...()

Error:

error TS2339: Property 'getByTestId' does not exist on type 'Canvas'

Reproduction link

http://example.com

Reproduction steps

Very hard to reproduce as this is coming as a regression on my storybook. Those are my addons:

addons: [
    getAbsolutePath("@storybook/addon-essentials"),
    getAbsolutePath("@storybook/addon-designs"),
    getAbsolutePath("@storybook/addon-themes"),
    getAbsolutePath("@chromatic-com/storybook"),
    getAbsolutePath("@storybook/experimental-addon-test"),
    getAbsolutePath("@storybook/addon-a11y"),
  ],

System

Storybook Environment Info:

  System:
    OS: macOS 15.1.1
    CPU: (10) arm64 Apple M1 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.proto/shims/node
    Yarn: 4.1.1 - ~/.proto/shims/yarn
    npm: 10.8.0 - ~/.proto/shims/npm <----- active
  Browsers:
    Safari: 18.1.1
  npmPackages:
    @storybook/addon-a11y: 8.5.2 => 8.5.2 
    @storybook/addon-essentials: 8.5.2 => 8.5.2 
    @storybook/addon-interactions: 8.5.2 => 8.5.2 
    @storybook/addon-themes: 8.5.2 => 8.5.2 
    @storybook/react: 8.5.2 => 8.5.2 
    @storybook/react-vite: 8.5.2 => 8.5.2 
    storybook: 8.5.2 => 8.5.2

Additional context

No response

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