-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary: ### Upgrading to v8.5.x Upgrading Storybook to experiment with the new test addon. We are doing this so we can test the new UI testing capabilities that work with `vitest` + `Playwright` under the hood. It will also get us closer to test the new a11y tooling that will be available in the next days. NOTE: This new feature is still under development by the Storybook team, so we are not yet ready to use it in production. You can see more information about this new testing approach here: - [Storybook Test bootcamp](https://storybook.us18.list-manage.com/track/click?u=06a6fce3ab1327784d4342396&id=2a2ca202c1&e=50b9ba02d5) - [Storybook Test addon docs](https://storybook.js.org/docs/writing-tests/test-addon) ### Integrating the new testing approach in CI Now that we have upgraded to the experimental version, we can take advantage of its new features. This PR adds a new step to our GH workflows: Running Storybook component tests in CI. Issue: XXX-XXXX ## Test plan: - Run `yarn storybook` and check if the new test addon is available. - Also check that the Chromatic storybook environment still works. Also verify how the storybook tests failed here: https://github.com/Khan/wonder-blocks/actions/runs/12057096671/job/33620982112 <img width="1041" alt="Screenshot 2024-11-28 at 2 50 17 PM" src="https://github.com/user-attachments/assets/472fb90b-d98a-442f-9434-d55b3ae87f5f"> Now check that these tests were fixed here: https://github.com/Khan/wonder-blocks/actions/runs/12074721182/job/33673231130#step:9:1024 <img width="1056" alt="Screenshot 2024-11-28 at 2 51 57 PM" src="https://github.com/user-attachments/assets/df2022d7-d64b-46f3-b740-bdfc052fce3b"> Author: jandrade Reviewers: jandrade, jeremywiebe, kevinb-khan, beaesguerra, marcysutton Required Reviewers: Approved By: kevinb-khan Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Chromatic - Build and test on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ gerald, ⏭️ dependabot Pull Request URL: #2373
- Loading branch information
Showing
13 changed files
with
1,664 additions
and
2,742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { beforeAll } from 'vitest'; | ||
import { setProjectAnnotations } from '@storybook/react'; | ||
import * as projectAnnotations from './preview'; | ||
|
||
// This is an important step to apply the right configuration when testing your stories. | ||
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations | ||
const project = setProjectAnnotations([projectAnnotations]); | ||
|
||
beforeAll(project.beforeAll); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.