Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

How to capture arguments to an action #144

@sw-tracker

Description

@sw-tracker

Hi there,

We are currently using storybook 7. And we would like to validate the arguments with which some actions are called. However, the other of the items needs to match exactly if we use the code below and this is making testing very difficult.

    expect(args.onError).toHaveBeenCalledWith(
      'ERROR_CODE',
      ['someError', 'someOtherError']
    );

We would like to capture the arguments so we can test them easier. How can we do this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions