storybookjs/storybook

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

開放

#21,519 建立於 2023年3月9日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (10,058 個分叉)batch import
addon: interactionsbughas workaroundhelp wantedsev:S4

倉庫指標

星標
 (89,909 顆星)
PR 合併指標
 (平均合併 7天 22小時) (30 天內合併 184 個 PR)

描述

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

貢獻者指南