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.
Description
Here's an update containing the changes I made with @MikeBLambert's help during office hours, as well as some additional tests specifically added to test input validation in the AddItem component, and a demonstration of unit testing just to be thorough. Also added some documentation about tests in the test and e2e folders
Added tests are not complete, but are representative of the kinds of tests that can be run on this project. See if you can use the structure here as a starting point to create new tests.
I made a few changes to AddItem.jsx and App.jsx to improve testability. Specifically, making the addItem function from firebase.js a prop allowed me to pass in a placeholder function, and only passing the names of items simplified test data.
One odd change that shouldn't get lost in all this text is that the app's package.json no longer has
type: module
. That property blocked the playwright tests.Type of Changes
Testing Steps / QA Criteria
Make sure the app still works
Try out Tests - Optional
npm run test
in the terminal. Not all tests should pass. Verify that the testing process completes.Proofread Documentation - Optional