storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.21k stars 9.26k forks source link

[Bug]: Addon-interactions. Interactions panel does not show steps after error has thrown even if I handle this error. #21746

Open original001 opened 1 year ago

original001 commented 1 year ago

Describe the bug

Intstumented functions always bubble up errors to interactions panel. But in play function I can handle error. After that code will continue to run and all interations will be done. But in my panel I won't see anything after error, which was handled.

image

To Reproduce

MyStory.play = async () => {
  await userEvent.type(getTokenInput(), "newComment");
  try {
    await screen.findByTestId("IdWhichDoesntExist");
  } catch (e) {}
  await userEvent.type(getTokenInput(), ",");
};

This function should type two times in input. But in panel you'll see only one operation and one error.

System

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 AMD Ryzen 7 4700U with Radeon Graphics
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.6.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (110.0.1587.57)   
  npmPackages:
    @storybook/addon-actions: ^6.5 => 6.5.16
    @storybook/addon-interactions: ^6.5.16 => 6.5.16
    @storybook/addons: ^6.5 => 6.5.16
    @storybook/builder-webpack5: ^6.5 => 6.5.16
    @storybook/jest: ^0.0.10 => 0.0.10
    @storybook/manager-webpack5: ^6.5 => 6.5.16
    @storybook/react: ^6.5 => 6.5.16
    @storybook/testing-library: ^0.0.13 => 0.0.13
    @storybook/ui: ^6.5 => 6.5.16

Additional context

No response

valentinpalkovic commented 1 year ago

cc @yannbf