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 login route backend tests. #130

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

FernFinder
Copy link
Contributor

@FernFinder FernFinder commented Apr 23, 2024

Overview

  • This pull request increases coverage of the login API to 100%. Each test bed will now disconnect from the database after all tests have been run.

Related Issue(s)

Changes

  • mongoose.disconnect() added to backend tests to ensure that connection to the database is closed after the test file has finished running.

Added

  • New file backend/tests/login.test.js has unit tests for the entire login API.

Changed

  • backend/tests/users.test.js modified slightly due to an indentation inconsistency I noticed. The code is indented uniformly now.

Screenshots

image

Instructions for Testing

Run npm run coverage on backend.

Checklist before Merging

  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate).
  • I have ensured the changes adhere to the project's coding standards and guidelines.

Additional Comments

77% Coverage

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@21bbbb1). Click here to learn what that means.

❗ Current head 7bd3539 differs from pull request most recent head 46f012d. Consider uploading reports for the commit 46f012d to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #130   +/-   ##
=======================================
  Coverage        ?   91.75%           
=======================================
  Files           ?       19           
  Lines           ?      291           
  Branches        ?       65           
=======================================
  Hits            ?      267           
  Misses          ?       22           
  Partials        ?        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Alexmc567 Alexmc567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Review:

  • Readability: Great description and well documented.

  • Code Quality: Code appears to be of high quality and is consistent with the project.

  • Testing: Testing instructions provided. Tests do work.

  • Functionality: Adds tests that appear to function correctly.

  • Housekeeping: No junk files, & lots of comments. Overall great contribution!

Copy link
Contributor

@barkangel barkangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Review

  • Readability:
    Code is easily readable with proper comments and documentation

  • Code Quality:
    Test cases in backend/tests/login.test.js created very well and structured appropriately

  • Testing:
    This PR improves test coverage of login page and users, good work

  • Functionality:
    Tests are functional as seen in coverage report increase in line % testing!

  • Additional Comments:
    Good work!
    PR Good to merge!

@FernFinder FernFinder merged commit 1084083 into UNLV-CS472-672:main Apr 23, 2024
1 check passed
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.

4 participants