Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cypress introduced component testing a few versions ago. While thinking about the classify features which don't have endpoints to test with yet, I thought it would be useful to explore component testing. They're easier to build out in isolation, and are much faster than e2e tests
Component testing is kind of like a mix of storybook and jest tests: like storybook, it renders your component in a browser, but like jest, you can actually test things (although you can use cypress commands, which we already know and love). It looks like storybook now also has interaction testing which might be the same thing except for within storybook. However, since we're already using cypress, it was easier to set this up.
Code Changes
DataCategoryInput
Steps to Confirm
npm run cy:open
. This will let you choose between E2E testing and component testing. Choose component testing, then watch it do its thingPre-Merge Checklist
CHANGELOG.md
Description Of Changes
Traditionally this sort of test should live next to the component. We don't have a habit of putting our components in their own folders though, so it would make our folder structure kind of messy. We may want to consider putting our components in lil folders for purposes like this (maybe storybook files would also go here, css modules [not that we really have any], unit tests...). I put them in
cypress/components
(the default installation path) for now, but we can always move them if people feel strongly about it.