storybookjs/storybook

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

Open

#21,746 opened on Mar 23, 2023

View on GitHub
 (3 comments) (0 reactions) (0 assignees)TypeScript (10,058 forks)batch import
addon: interactionsbuggood first issuehelp wantedsev:S3

Repository metrics

Stars
 (89,909 stars)
PR merge metrics
 (Avg merge 7d 22h) (184 merged PRs in 30d)

Description

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

Contributor guide