Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate relevant tests to Storybook play functions. #129

Open
brian-mcallister-lab49 opened this issue Dec 28, 2022 · 0 comments
Open

Migrate relevant tests to Storybook play functions. #129

brian-mcallister-lab49 opened this issue Dec 28, 2022 · 0 comments

Comments

@brian-mcallister-lab49
Copy link
Member

brian-mcallister-lab49 commented Dec 28, 2022

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant