-
Notifications
You must be signed in to change notification settings - Fork 29
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
test(app-project): mock Zooniverse APIs in stories with MSW #6406
test(app-project): mock Zooniverse APIs in stories with MSW #6406
Conversation
c46481a
to
0eb8eb8
Compare
8fdcf92
to
bfa63a1
Compare
packages/app-project/src/shared/components/SubjectPicker/SubjectPicker.spec.js
Outdated
Show resolved
Hide resolved
d0bd56a
to
e8ee482
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used the same config here that I use to test client-side React components with Storybook 8, so this should be forward compatible.
66caf17
to
ef6d118
Compare
] | ||
}) | ||
const DefaultStory = composeStory(Default, Meta) | ||
await applyRequestHandlers(DefaultStory.parameters.msw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed in Storybook 7, but 8 handles it automatically for you.
b927fd2
to
b1c0cd6
Compare
b1c0cd6
to
dd58209
Compare
290f6b5
to
226be8a
Compare
226be8a
to
c7df955
Compare
Phew 😌 I messed up there for a minute by pushing changes before including the latest dependency bumps from the master branch. I made two changes:
|
skip a couple of Mocha tests that now fail with errors.all the tests should still pass.Package
Linked Issue and/or Talk Post
How to Review
Running the dev storybook locally, there are a couple of new stories:
http://localhost:9001/?path=/story/project-app-shared-subject-picker--default
http://localhost:9001/?path=/story/project-app-shared-workflow-selector--missing-levels
You can test the deployed storybook (
NODE_ENV=production
) with:I've skipped a couple of tests that are failing with errors. I'm not sure why they fail. I think it might be happening because stories are designed to run in a browser, but the tests run in Node.Mocha tests, withnock
to mock the Panoptes API in Node, should still run and pass on this branch.Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expected