Skip to content
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

Added Tests #33

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Added Tests #33

wants to merge 5 commits into from

Conversation

lydiadunning
Copy link
Collaborator

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

Type
πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
βœ“ πŸ’― Add tests
βœ“ πŸ”— Update dependencies
βœ“ πŸ“œ Docs

Testing Steps / QA Criteria

Make sure the app still works

  1. Launch the demo- verify it starts
  2. Interact with the demo, verify it behaves normally

Try out Tests - Optional

  1. Pull down the build. Install dependencies.
  2. Try running all Vitest tests by entering npm run test in the terminal. Not all tests should pass. Verify that the testing process completes.
  3. Try running all Playwright tests by entering 'npm run e2e' in the terminal. Verify that the testing process completes.

Proofread Documentation - Optional

  1. Look at the README.md files in both the test and e2e folders.
  2. Try following the directions written there to see if they produce the expected results.

@github-actions
Copy link

github-actions bot commented Sep 25, 2023

Visit the preview URL for this PR (updated for commit 5863ec0):

https://tcl-65-smart-shopping-list--pr33-add-tests-01ogv17z.web.app

(expires Wed, 04 Oct 2023 16:12:41 GMT)

πŸ”₯ via Firebase Hosting GitHub Action 🌎

Sign: a91b8fb0f37677e20d8afa3e8ea496251536f9b8

@shannonerhea
Copy link
Collaborator

Love the README files. This branch has conflicts once fixed we can merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants