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

Add Storybook tests #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Storybook tests #137

wants to merge 1 commit into from

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented Feb 26, 2025

Prevent regressions in our custom components by adding Storybook testing. Copy Storybook tests from the archived gravitational/docs repo. Add a rough-and-ready Storybook configuration to enable tests to pass.

One significant complication is that Docusaurus generates a Webpack configuration when building a docs site. There are Storybook frameworks and add-ons for Docusaurus that take advantage of Docusaurus's asset-loading logic, but none are currently being maintained. The quickest thing we can do is add a separate Webpack configuration that renders components in Storybook similarly (but not identically) to the Docusaurus site.

A separate change can refine this approach by, for example:

  • Vendoring a Storybook Docusaurus framework
  • Migrating Storybook tests to react-testing-library

Copy link

github-actions bot commented Feb 26, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/17-storybook aef9425 40 🔄RUNNING paul-gottschling-17-storybook 2025-03-04 18:15:25

@ptgott ptgott force-pushed the paul.gottschling/17-storybook branch from 44cc6b3 to e8b2a97 Compare February 26, 2025 20:25
@ptgott ptgott marked this pull request as draft February 26, 2025 21:44
@ptgott ptgott force-pushed the paul.gottschling/17-storybook branch from e8b2a97 to a09ee70 Compare February 27, 2025 15:26
@ptgott ptgott force-pushed the paul.gottschling/17-storybook branch from a09ee70 to 65a3581 Compare February 27, 2025 15:33
@ptgott ptgott force-pushed the paul.gottschling/17-storybook branch from 231d71f to 87cf186 Compare February 27, 2025 16:04
@ptgott ptgott force-pushed the paul.gottschling/17-storybook branch from 631b857 to d935d2b Compare March 4, 2025 17:51
@ptgott ptgott force-pushed the paul.gottschling/17-storybook branch from d935d2b to 56d24cb Compare March 4, 2025 17:58
Prevent regressions in our custom components by adding Storybook
testing. Copy Storybook tests from the archived `gravitational/docs`
repo. Add a rough-and-ready Storybook configuration to enable tests to
pass.

One significant complication is that Docusaurus generates a Webpack
configuration when building a docs site. There are Storybook frameworks
and add-ons for Docusaurus that take advantage of Docusaurus's
asset-loading logic, but none are currently being maintained. The
quickest thing we can do is add a separate Webpack configuration that
renders components in Storybook similarly (but not identically) to the
Docusaurus site.

A separate change can refine this approach by, for example:
- Vendoring a Storybook Docusaurus framework
- Migrating Storybook tests to `react-testing-library`

Also add a step to the `Run tests` GitHub Actions job to run the
Storybook tests.
@ptgott ptgott force-pushed the paul.gottschling/17-storybook branch from 56d24cb to aef9425 Compare March 4, 2025 18:00
@ptgott ptgott deployed to docs-amplify March 4, 2025 18:00 — with GitHub Actions Active
@ptgott ptgott marked this pull request as ready for review March 4, 2025 18:15
@ptgott ptgott requested a review from avatus March 4, 2025 18:15
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

Successfully merging this pull request may close these issues.

1 participant