-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 tests to various hooks #16293
Add tests to various hooks #16293
Conversation
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.
Can we add testing for useWorkspace()
? That is the only hook I see in the ConnectionFormService
that isn't addressed in this PR.
💥 so many tests added. I don't see any gaps I can think of beyond the missing hook.
I said the incorrect service above, I meant |
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.
looks like the tests pass
* Move testutils to test-utils folder * Add mock data * Add analytics provider to test renderer * Add hooks.test.ts, test useUniqueFormId * Add tests for mapFormPropsToOperation and useInitialValues
* Move testutils to test-utils folder * Add mock data * Add analytics provider to test renderer * Add hooks.test.ts, test useUniqueFormId * Add tests for mapFormPropsToOperation and useInitialValues
What
Due to the size of the Connection Form Refactor PR I've split out some of the testing done there into its own PR.
Additionally,
src/test-utils
was created to hold ourtestutils.ts
as well as some mock data.The AnalyticsProvider was added to our central test render wrapper.
The snapshot tests for
useInitialValues
will let us know if any changes made to the code there have unexpected consequences.Recommended reading order
Any, filter out the mock data json files.
🚨 User Impact 🚨
None. Tests will fail or the app will fail to build if this breaks anything.