Skip to content

Feature : Improve User Model Test Coverage and Reliability#718

Open
JayRathore10 wants to merge 2 commits into
GitMetricsLab:mainfrom
JayRathore10:test/user-model-edge-cases-v2
Open

Feature : Improve User Model Test Coverage and Reliability#718
JayRathore10 wants to merge 2 commits into
GitMetricsLab:mainfrom
JayRathore10:test/user-model-edge-cases-v2

Conversation

@JayRathore10

Copy link
Copy Markdown
Contributor

Description

This PR enhances the User Model test suite by adding missing edge-case and validation test coverage while preserving all existing functionality and tests.

Changes Made

Added Validation Tests

  • Verify user creation fails when username is missing
  • Verify user creation fails when email is missing
  • Verify user creation fails when password is missing

Added Password Rehash Tests

  • Verify password is rehashed when updated
  • Verify old hash is replaced after password modification
  • Verify updated password matches the new hash

Added comparePassword Edge Cases

  • Verify empty password comparison returns false
  • Verify incorrect password comparison returns false

Added Security Tests

  • Verify users with the same plaintext password receive different bcrypt hashes due to salting
  • Verify stored password is never equal to plaintext password

Test Reliability Improvements

  • Added additional edge-case coverage without modifying existing working tests
  • Maintained backward compatibility with the current test suite

Testing

  • All existing tests pass
  • All newly added tests pass
  • No changes made to application logic

Related Issue

Closes #717

GSSoC 2026

This contribution is submitted under GSSoC 2026.

GSSoC Profile:
https://gssoc.girlscript.org/profile/e47b2f4a-f3e9-4cb4-97b5-ddd8cb15a1e9

@netlify

netlify Bot commented Jun 6, 2026

Copy link
Copy Markdown

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit d86c019
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a23d503d030dc000864414f
😎 Deploy Preview https://deploy-preview-718--github-spy.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 project configuration.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

PR changed again? Review this PR in Change Stack to compare snapshots and stay oriented.

Review Change Stack

Warning

Review limit reached

@JayRathore10, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 10 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 52b76d01-7ec2-4f2a-b3d7-012c6204db1e

📥 Commits

Reviewing files that changed from the base of the PR and between 53f820b and d86c019.

📒 Files selected for processing (1)
  • spec/user.model.spec.cjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JayRathore10

JayRathore10 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

@mehul-m-prajapati Check out this PR. Under GSSoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Feature: Improve User Model Test Coverage and Reliability

1 participant