Skip to content

Migrate relevant tests to Storybook play functions. #129

@brian-mcallister-lab49

Description

@brian-mcallister-lab49

I've already created one play function for one of the stories, here's the relevant snipped from a recent commit:

CurrencyFormatter.play = async ({ canvasElement }) => {
const canvas = within(canvasElement);
await expect(canvas.getByText("$20,000.00")).toBeInTheDocument();
await userEvent.click(canvas.getByTestId("first-button"));
await expect(canvas.getByText("$20,001.00")).toBeInTheDocument();
};

I've also validated that we can run it locally (with npm run test-storybook) and in CI (which uses Chromatic to run the interaction tests).

Let's look into doing a few things:

  1. Move all relevant tests out of standalone Jest and into Storybook play functions. This gives us the ability to rely on the existing stories that have been written to set up test cases, and also could (if we move all tests) allow us to simply drop all the testing dependencies.
  2. Collect coverage stats and forward them on to Codecov.

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