GTBitsOfGood / angels-among-us

Rescue one until there are none
https://staging--angels-among-us.netlify.app
MIT License
4 stars 0 forks source link

added some error catching to remove confusion with firebase errors. #322

Closed austin-bmitchell15 closed 7 months ago

austin-bmitchell15 commented 7 months ago

Firebase Error Catching

Issue Number(s): N/A.

What does this PR change and why? Checks for some common errors that firebase throws so that the user can understand it better.

Checklist

Critical Changes

Related PRs

Testing

Enumerate steps to test the functionality of your ticket. This should include edge cases and testing of error handling, if applicable.

netlify[bot] commented 7 months ago

Deploy Preview for angels-among-us ready!

Name Link
Latest commit a8d52068db53bd931d36f70644a79f8e96624ca3
Latest deploy log https://app.netlify.com/sites/angels-among-us/deploys/66083a9e1fa70000084ba18a
Deploy Preview https://deploy-preview-322--angels-among-us.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

github-actions[bot] commented 7 months ago

Coverage report for web

[!CAUTION] Test run failed

St.:grey_question:
Category Percentage Covered / Total
🔴 Statements
22.64% (-0.08% 🔻)
524/2314
🔴 Branches
7.86% (-0.08% 🔻)
61/776
🔴 Functions 12.33% 83/673
🔴 Lines
18.82% (-0.07% 🔻)
388/2062

Test suite run failed

Failed tests: 17/44. Failed suites: 2/7.
``` ● [DB] Account - Unit Test › findAccount › happy ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › findAccount › all caps email ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › findAccount › unauthorized email ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › findAccount › db error ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › removeAllAccounts › happy ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › removeAllAccounts › unauthorized account ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › removeAllAccounts › authorized with unauthorized accounts ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › updateAccount › happy ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › updateAccount › unauthorized account ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › addAccount › happy ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › addAccount › existing account ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › findAll › happy ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › findAll › db error ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › searchAccounts › happy ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] Account - Unit Test › searchAccounts › not found ValidationError: Account validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ``` --- ``` ● [DB] User - Unit Test › searchUsers › happy ValidationError: User validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ● [DB] User - Unit Test › searchUsers › empty array ValidationError: User validation failed: lowerEmail: Path `lowerEmail` is required. at model.Object..Document.invalidate (node_modules/mongoose/lib/document.js:3174:32) at node_modules/mongoose/lib/document.js:2962:17 at node_modules/mongoose/lib/schematype.js:1349:9 ```

Report generated by 🧪jest coverage report action from a8d52068db53bd931d36f70644a79f8e96624ca3