Skip to content

test: add unit tests for rubrics service - #1363

Open
ugoocreates-pixel wants to merge 1 commit into
rinafcode:mainfrom
ugoocreates-pixel:test-rubrics-service
Open

test: add unit tests for rubrics service#1363
ugoocreates-pixel wants to merge 1 commit into
rinafcode:mainfrom
ugoocreates-pixel:test-rubrics-service

Conversation

@ugoocreates-pixel

Copy link
Copy Markdown

Closes #1262

Adds comprehensive unit testing for RubricsService to ensure its behavior is verified and regressions are prevented.

Changes include:

  • A new NestJS Test.createTestingModule setup using mocked repositories and a mocked TypeORM DataSource transaction runner.
  • Happy-path tests for all public methods (create, findOne, findAll, update, remove).
  • Coverage for edge-cases and error-handling paths such as:
    • Validation errors during creation (e.g. out-of-bounds defaultLevelIndex, insufficient maxPoints, or autoGradeEnabled requirement checks).
    • Validation errors during update (e.g. attempting to enable auto-grading when criteria are missing defaults).
    • NotFoundException when a rubric cannot be fetched.
    • ForbiddenException for unauthorized owner actions on updates and removals.

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@ugoocreates-pixel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Well done on the job done so far!
Kindly fix workflow to pass

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.

Add unit tests for rubrics service

2 participants