storybookjs/storybook

[Bug]: Interactions - When step function is not awaited, it gets lost in debugger

オープン

#21,519 opened on 2023/03/09

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (10,058 件のフォーク)batch import
addon: interactionsbughas workaroundhelp wantedsev:S4

Repository metrics

Stars
 (89,909 個のスター)
PR merge metrics
 (平均マージ 7d 22h) (30d で 184 merged PRs)

説明

Describe the bug

2023-03-09 16 28 50

This happens if the play function looks like this:

play: async ({ canvasElement, step }) => {
    const canvas = within(canvasElement);
    const loginButton = await canvas.getByRole('button', {
      name: /Log in/i,
    });
    await userEvent.click(loginButton);
    // This should be awaited. If it's not, the panel bugs out.
    step('click', async () => {
      await userEvent.click(loginButton);
    })
}

To Reproduce

https://stackblitz.com/edit/github-wmyzqk?file=src%2Fstories%2FPage.stories.ts&preset=node

System

No response

Additional context

No response

コントリビューターガイド